protected void ui_BtnDelete_Click(object sender, EventArgs e) { ImageButton btn = (ImageButton)sender; Companies objData = new Companies(); objData.LoadByPrimaryKey(Int32.Parse(btn.CommandArgument)); objData.MarkAsDeleted(); objData.Save(); BindAllCompanies(); }
/// <summary> /// Add Company Info /// </summary> private void AddCompanyInfo() { try { Companies objData = new Companies(); objData.AddNew(); objData.CompNameEng = ui_txtCompNameEn.Text; objData.CompNameAr = ui_txtCompNameAr.Text; objData.Comp_Code = ui_txtCompCode.Text; objData.OLD_EMAIL = ui_txtOldEmail.Text; objData.Doctor_Name = ui_txtName1.Text; objData.New_Email = ui_txtNewEmail1.Text; objData.Phone_Number = ui_txtNumber1.Text; objData.Doctor_Name_2 = ui_txtName2.Text; objData.New_Email_2 = ui_txtNewEmail2.Text; objData.Phone_Number2 = ui_txtNumber2.Text; objData.Checked = true; objData.Save(); ui_lb_msg.ForeColor = System.Drawing.Color.Green; ui_lb_msg.Text = "The new record saved successfully"; ResetFields(); } catch { ui_lb_msg.ForeColor = System.Drawing.Color.Red; ui_lb_msg.Text = "Problem while saving the new record"; } }