示例#1
0
        public int SaveCallLinks(Entity.Sales.Calls Model)
        {
            CallsDbModel DbModel = new CallsDbModel();

            Model.CopyPropertiesTo(DbModel);
            return(CallsDataAccess.SaveCallLinks(DbModel));
        }
 private void SaveCallLink()
 {
     Business.Sales.Calls Obj   = new Business.Sales.Calls();
     Entity.Sales.Calls   Model = new Entity.Sales.Calls
     {
         Id       = CallId,
         LinkId   = Convert.ToInt32(hdnItemId.Value),
         LinkType = (SalesLinkType)Enum.Parse(typeof(SalesLinkType), hdnItemType.Value)
     };
     Obj.SaveCallLinks(Model);
 }
 private void GetCallById()
 {
     Business.Sales.Calls Obj   = new Business.Sales.Calls();
     Entity.Sales.Calls   calls = Obj.GetCallById(CallId);
     if (calls.Id != 0)
     {
         ddlCallDirection.SelectedValue  = calls.CallDirectionId.ToString();
         ddlCallRelatedTo.SelectedValue  = calls.CallRelatedTo.ToString();
         ddlCallRepeatType.SelectedValue = calls.CallRepeatTypeId.ToString();
         ddlCallStatus.SelectedValue     = calls.CallStatusId.ToString();
         txtDescription.Text             = calls.Description;
         txtCallStartDateTime.Value      = calls.StartDateTime.ToString("dd MMM yyyy HH:mm tt");
         txtCallEndDateTime.Value        = calls.EndDateTime.ToString("dd MMM yyyy HH:mm tt");
         txtSubject.Text          = calls.Subject;
         chkEmailReminder.Checked = calls.EmailReminder;
         chkPopupReminder.Checked = calls.PopupReminder;
     }
 }
 private void Save()
 {
     if (CallControlValidation())
     {
         Business.Sales.Calls Obj   = new Business.Sales.Calls();
         Entity.Sales.Calls   Model = new Entity.Sales.Calls
         {
             Id = CallId,
             CallDirectionId  = Convert.ToInt32(ddlCallDirection.SelectedValue),
             CallRelatedTo    = Convert.ToInt32(ddlCallRelatedTo.SelectedValue),
             CallRepeatTypeId = Convert.ToInt32(ddlCallRepeatType.SelectedValue),
             CallStatusId     = Convert.ToInt32(ddlCallStatus.SelectedValue),
             CreatedBy        = Convert.ToInt32(HttpContext.Current.User.Identity.Name),
             Description      = txtDescription.Text,
             Subject          = txtSubject.Text,
             StartDateTime    = Convert.ToDateTime(txtCallStartDateTime.Value),
             EndDateTime      = Convert.ToDateTime(txtCallEndDateTime.Value),
             EmailReminder    = chkEmailReminder.Checked,
             PopupReminder    = chkPopupReminder.Checked,
             IsActive         = true
         };
         CallId = Obj.SaveCalls(Model);
         if (CallId > 0)
         {
             SaveCallLink();
             ClearControls();
             LoadCallList();
             CallId            = 0;
             Message.IsSuccess = true;
             Message.Text      = "Saved Successfully";
         }
         else
         {
             Message.IsSuccess = false;
             Message.Text      = "Unable to save data.";
         }
         Message.Show = true;
     }
 }
示例#5
0
 public Entity.Sales.Calls GetCallById(int Id)
 {
     Entity.Sales.Calls call = new Entity.Sales.Calls();
     CallsDataAccess.GetCallById(Id).CopyPropertiesTo(call);
     return(call);
 }