当前位置: 首页>>代码示例>>C#>>正文


C# Report.UpdateUser方法代码示例

本文整理汇总了C#中Attendance.BAL.Report.UpdateUser方法的典型用法代码示例。如果您正苦于以下问题:C# Report.UpdateUser方法的具体用法?C# Report.UpdateUser怎么用?C# Report.UpdateUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Attendance.BAL.Report的用法示例。


在下文中一共展示了Report.UpdateUser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnUpdate_Click


//.........这里部分代码省略.........
                                System.IO.Directory.CreateDirectory(SaveFileLoc);
                            }

                            string FileNameSaveData = SaveFileLoc + (objInfo.Firstname.Trim() + objInfo.Lastname.Trim()).Trim() + ".jpeg";
                            PhotoLink = (objInfo.Firstname.Trim() + objInfo.Lastname.Trim()).Trim() + ".jpeg";


                            photoUpload1.SaveAs(FileNameSaveData);
                            Bitmap oBitmap = default(Bitmap);
                            oBitmap = new Bitmap(FileNameSaveData);
                            Graphics oGraphic = default(Graphics);

                            int newwidthimg = 140;
                            // Here create a new bitmap object of the same height and width of the image.
                            // float AspectRatio = (float)oBitmap.Size.Width / (float)oBitmap.Size.Height;

                            int newHeight = 140;

                            Bitmap bmpNew = new Bitmap(newwidthimg, newHeight);
                            oGraphic = Graphics.FromImage(bmpNew);

                            oGraphic.CompositingQuality = CompositingQuality.HighQuality;
                            oGraphic.SmoothingMode = SmoothingMode.HighQuality;
                            oGraphic.InterpolationMode = InterpolationMode.HighQualityBicubic;


                            oGraphic.DrawImage(oBitmap, new Rectangle(0, 0, bmpNew.Width, bmpNew.Height), 0, 0, oBitmap.Width, oBitmap.Height, GraphicsUnit.Pixel);
                            // Release the lock on the image file. Of course,
                            // image from the image file is existing in Graphics object
                            oBitmap.Dispose();
                            oBitmap = bmpNew;

                            //SolidBrush oBrush = new SolidBrush(Color.Black);
                            //Font ofont = new Font("Arial", 8);
                            //oGraphic.DrawString("Some text to write", ofont, oBrush, 10, 10);
                            //oGraphic.Dispose();
                            //ofont.Dispose();
                            //oBrush.Dispose();
                            oBitmap.Save(FileNameSaveData, ImageFormat.Jpeg);

                            oBitmap.Dispose();


                        }
                    }
                }
                catch (Exception ex)
                {
                    System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('File access denied');", true);
                }

                //objInfo.Lastname = GeneralFunction.ToProper(txtEditLastname.Text.Trim());
                objInfo.ScheduleID = Convert.ToInt32(ddlSchedule.SelectedItem.Value);
                objInfo.EmpTypeID = Convert.ToInt32(ddlEmpType.SelectedItem.Value);
                objInfo.Deptname = ddlEditDepart.SelectedItem.Text.ToString();
                objInfo.Designation = GeneralFunction.ToProper(txtEditDesg.Text.Trim());
                objInfo.StartDt = txtEditStartDate.Text == "" ? Convert.ToDateTime("01/01/1900") : Convert.ToDateTime(txtEditStartDate.Text);
                objInfo.TermDt = txtEditTermDate.Text == "" ? Convert.ToDateTime("01/01/1900") : Convert.ToDateTime(txtEditTermDate.Text);
                objInfo.TermReason = txtEdit1TermReason.Text.Trim();
                if (rdEditActiveFalse.Checked == true)
                {
                    objInfo.IsActive = false;
                }
                else
                {
                    objInfo.IsActive = true;
                    objInfo.TermDt = Convert.ToDateTime("01/01/1900");
                    objInfo.TermReason = "";
                }

                Attendance.BAL.Report obj = new Report();
                String strHostName = Request.UserHostAddress.ToString();
                string strIp = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
                bool bnew = obj.UpdateUser(objInfo, EmployeeID, UserID, PhotoLink, strIp);
                if (bnew)
                {
                    btnUpdate.Enabled = true;
                    btnEditCancel.Enabled = true;
                    mdlEditPopup.Hide();
                    txtEdit1TermReason.Text = "";
                    txtEditTermDate.Text = "";
                    txtEditDesg.Text = "";
                    txtEditEmpID.Text = "";
                    txtEditFirstname.Text = "";
                    txtEditLastname.Text = "";
                    txtEditStartDate.Text = "";
                    ddlEditDepart.SelectedIndex = 0;
                    ddlEmpType.SelectedIndex = 0;
                    ddlSchedule.SelectedIndex = 0;
                    GetEmpDet(EmployeeID);

                }
            }


            catch (Exception ex)
            {

            }
        }
开发者ID:BInny1,项目名称:HR.bizstrides,代码行数:101,代码来源:EmployeDetails.aspx.cs


注:本文中的Attendance.BAL.Report.UpdateUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。