private void btnUserSave_Click(object sender, EventArgs e) { Image admin_pic = picUser.Image; admin_pic.Save("images//admin//" + txtUserCNIC.Text + ".jpg"); if (IsFormValidate()) { CollageAdmin objAdmin = new CollageAdmin(); objAdmin.UserId = Convert.ToInt32(txtUserName.Tag); objAdmin.UserEmail = txtUserEmail.Text; objAdmin.UserName = txtUserName.Text; objAdmin.UserPassword = txtUserPassword.Text; objAdmin.UserRole = cmbUserRole.Text; objAdmin.UserContectNo = txtUserContactNo.Text; objAdmin.UserCNIC = txtUserCNIC.Text; objAdmin.AddedById = Convert.ToInt32(this.Tag); objAdmin.AddedByDateTime = DateTime.Now; objAdmin.UserIsEnabled = true; objAdmin.LastEnableDateTime = DateTime.Now; objAdmin.Remarks = txtUserRemarks.Text; objAdmin.UserPic = "images//admin//" + txtUserCNIC.Text + ".jpg"; long UserId = objAdmin.InsertUpdateCollageAdmin(); if (UserId > 0) { UserDataGridView.DataSource = CollageAdminController.CollageAdminSelectAll(); SuccessMessage.SHowDialog("Record Entered Successfully"); txtUserName.Focus(); } else { ErrorMessage.SHowDialog("Error in Entry"); txtUserName.Focus(); } } }
public static Int64 InsertUpdateCollageAdmin(CollageAdmin objIUCollageAdmin) { Int64 new_id = objIUCollageAdmin.InsertUpdateCollageAdmin(); return(new_id); }