public void BindddlGroupName() { iTermConditionMasterClient TermsClient = new iTermConditionMasterClient(); try { CustomProfile profile = CustomProfile.GetProfile(); //chkBLstGroupname.DataSource = TermsClient.GetGroupListToBindDDL(profile.DBConnection._constr); chkBLstGroupname.DataSource = TermsClient.GetGroupListToBindDDLDropdown(profile.DBConnection._constr); chkBLstGroupname.DataBind(); } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "Terms & Conditions Master", "BindddlGroupName"); } finally { TermsClient.Close(); } }
protected void pageSave(Object sender, ToolbarService.iUCToolbarClient e) { iTermConditionMasterClient TermsClient = new iTermConditionMasterClient(); try { CustomProfile profile = CustomProfile.GetProfile(); mTermsCondition objTerms = new mTermsCondition(); if (hdnTermID.Value == string.Empty) { if (chkBLstGroupname.SelectedIndex >= 0) { for (int i = 0; i <= chkBLstGroupname.Items.Count - 1; i++) { if (chkBLstGroupname.Items[i].Selected == true) { objTerms.Term = txtTermName.Text.Trim(); objTerms.Condition = txtCondition.Text; objTerms.TCGroupID = Convert.ToInt64(chkBLstGroupname.Items[i].Value); objTerms.Sequence = 0; if (rbtnYes.Checked == true) { objTerms.Active = "Y"; } else { objTerms.Active = "N"; } objTerms.CreatedBy = profile.Personal.UserID.ToString(); objTerms.CreationDate = DateTime.Now; objTerms.CompanyID = profile.Personal.CompanyID; objTerms.CompanyID = long.Parse(ddlCompany.SelectedItem.Value); objTerms.CustomerID = long.Parse(hdncustomerid.Value); int result = TermsClient.InsertmTermsCondition(objTerms, profile.DBConnection._constr); } } WebMsgBox.MsgBox.Show("Record saved successfully"); BindGrid(); clear(); } else { WebMsgBox.MsgBox.Show("Please select Group"); } } else { if (chkBLstGroupname.SelectedIndex >= 0) { for (int i = 0; i <= chkBLstGroupname.Items.Count - 1; i++) { if (chkBLstGroupname.Items[i].Selected == true) { objTerms = TermsClient.GetTermConditionListByID(Convert.ToInt32(hdnTermID.Value), profile.DBConnection._constr); objTerms.Term = txtTermName.Text.Trim(); objTerms.Condition = txtCondition.Text; objTerms.TCGroupID = Convert.ToInt64(chkBLstGroupname.Items[i].Value); objTerms.Sequence = 0; if (rbtnYes.Checked == true) { objTerms.Active = "Y"; } else { objTerms.Active = "N"; } objTerms.LastModifiedBy = profile.Personal.UserID.ToString(); objTerms.LastModifiedDate = DateTime.Now; objTerms.CompanyID = long.Parse(ddlCompany.SelectedItem.Value); int result = TermsClient.updatemTermsCondition(objTerms, profile.DBConnection._constr); } } WebMsgBox.MsgBox.Show("Record updated successfully"); BindGrid(); clear(); } else { WebMsgBox.MsgBox.Show("Please select Group"); } } } //} catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "Terms & Conditions Master", "pageSave"); } finally { } }