public void UpdateCallRecords(Obj.CallRecords obj) { try { parameters.Add(new SqlParameter("@CallID", SqlDbType.BigInt), obj.CallID); parameters.Add(new SqlParameter("@CallDateTime", SqlDbType.DateTime), obj.CallDateTime); parameters.Add(new SqlParameter("@ContactID", SqlDbType.Int), obj.ContactID); parameters.Add(new SqlParameter("@CallingPerson", SqlDbType.VarChar, 50), obj.CallingPerson); parameters.Add(new SqlParameter("@CompanyName", SqlDbType.VarChar, 50), obj.CompanyName); parameters.Add(new SqlParameter("@CallingNo", SqlDbType.VarChar, 20), obj.CallingNo); parameters.Add(new SqlParameter("@CategoryID", SqlDbType.TinyInt), obj.CategoryID); parameters.Add(new SqlParameter("@CallDetail", SqlDbType.VarChar, 200), obj.CallDetail); parameters.Add(new SqlParameter("@IsOutgoing", SqlDbType.Bit), obj.IsOutgoing); parameters.Add(new SqlParameter("@City", SqlDbType.VarChar, 50), obj.City); parameters.Add(new SqlParameter("@CallStatus", SqlDbType.VarChar, 20), obj.CallStaus); new Database().ExecuteNonQueryOnly("Sp_Update_CallRecords", parameters); } catch (Exception ex) { throw ex; } }
public void UpdateCallRecords(Obj.CallRecords obj) { try { new DAL.CallRecords().UpdateCallRecords(obj); } catch (Exception ex) { throw ex; } }
public void InsertCallRecords(Obj.CallRecords obj) { try { new DAL.CallRecords().InsertCallRecords(obj); } catch (Exception ex) { throw ex; } }
private Obj.CallRecords assignToObj() { Obj.CallRecords obj = new Obj.CallRecords(); obj.CallDateTime = this.dtCallRecord.Value; if (Convert.ToInt32(this.cbxContactPerson.SelectedValue) > 0) { obj.ContactID = Convert.ToInt32(cbxContactPerson.SelectedValue); obj.CallingPerson = cbxContactPerson.Text; } else { obj.ContactID = 0; obj.CallingPerson = cbxContactPerson.Text; } obj.CompanyName = this.txtCompanyName.Text; obj.CallingNo = this.txtMobileNo1.Text; obj.CategoryID = Convert.ToInt32(this.cbxCategory.SelectedValue); obj.CallDetail = this.txtCallDetails.Text; if (this.rdbIsOutGoing.Checked) { obj.IsOutgoing = true; } else { obj.IsOutgoing = false; } if (this.txtCallRecordIdHiden.Text == "") { obj.CallID = 0; } else { obj.CallID = Convert.ToInt32(this.txtCallRecordIdHiden.Text); } if (this.cbxContactPerson.SelectedValue == null || Convert.ToInt32(this.cbxContactPerson.SelectedValue) < 0) { DialogResult dr = MessageBox.Show("This Contact is not found in our database would you like to save this new contact", "New Contact", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { if (this.btnSave.Text == "Save") { insertContact(); } //else if(btnSave.Text=="Update") //{ // updateContact(); //} } //else //{ //} } if (this.cboCity.SelectedIndex < 1) { obj.City = ""; } else { obj.City = this.cboCity.Text; } obj.CallStaus = this.cbxCallStatus.Text; return(obj); }