public int UpdateMarketingInfo(int marketingInfoId, MRK_MarketingInfo aMRK_MarketingInfo)
        {
            try
            {
                MRK_MarketingInfo MRK_MarketingInfo = _context.MRK_MarketingInfo.First(x => x.MarketingInfoId == marketingInfoId);
                MRK_MarketingInfo.VisitDate     = aMRK_MarketingInfo.VisitDate;
                MRK_MarketingInfo.Client        = aMRK_MarketingInfo.Client;
                MRK_MarketingInfo.ContactPerson = aMRK_MarketingInfo.ContactPerson;
                MRK_MarketingInfo.Designation   = aMRK_MarketingInfo.Designation;
                MRK_MarketingInfo.ContactNumber = aMRK_MarketingInfo.ContactNumber;
                MRK_MarketingInfo.Email         = aMRK_MarketingInfo.Email;
                MRK_MarketingInfo.Address       = aMRK_MarketingInfo.Address;
                MRK_MarketingInfo.ProjectId     = aMRK_MarketingInfo.ProjectId;
                MRK_MarketingInfo.Module        = aMRK_MarketingInfo.Module;
                MRK_MarketingInfo.StageId       = aMRK_MarketingInfo.StageId;
                MRK_MarketingInfo.Remarks       = aMRK_MarketingInfo.Remarks;
                MRK_MarketingInfo.ReferenceId   = aMRK_MarketingInfo.ReferenceId;

                MRK_MarketingInfo.Edit_User = aMRK_MarketingInfo.Edit_User;
                MRK_MarketingInfo.Edit_Date = aMRK_MarketingInfo.Edit_Date;
                MRK_MarketingInfo.OCODE     = aMRK_MarketingInfo.OCODE;

                _context.SaveChanges();
                return(1);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public void LoadData()
        {
            MRK_MarketingInfo aMRK_MarketingInfo = new MRK_MarketingInfo();
            string            marketingInfoIds   = "";

            try
            {
                string OCODE = Convert.ToString(((SessionUser)Session["SessionUser"]).OCode);
                marketingInfoIds = Session["MarketingId"].ToString();

                aMRK_MarketingInfo = aMarketingInfoBLL.GetMarketingInfoForEdit(marketingInfoIds, OCODE);

                if (aMRK_MarketingInfo != null)
                {
                    visitDateTextBox.Text                     = aMRK_MarketingInfo.VisitDate.ToString();
                    clientNameTextBox.Text                    = aMRK_MarketingInfo.Client.ToString();
                    contactPersonTextBox.Text                 = aMRK_MarketingInfo.ContactPerson.ToString();
                    designationTextBox.Text                   = aMRK_MarketingInfo.Designation.ToString();
                    contactNumberTextBox.Text                 = aMRK_MarketingInfo.ContactNumber.ToString();
                    emailTextBox.Text                         = aMRK_MarketingInfo.Email.ToString();
                    addressTextBox.Text                       = aMRK_MarketingInfo.Address.ToString();
                    projectDropDownList.SelectedValue         = aMRK_MarketingInfo.ProjectId.ToString();
                    moduleTextBox.Text                        = aMRK_MarketingInfo.Module.ToString();
                    stageDropDownList.SelectedValue           = aMRK_MarketingInfo.StageId.ToString();
                    referenceDropDownList.SelectedValue       = aMRK_MarketingInfo.ReferenceId.ToString();
                    remarksTextBox.Text                       = aMRK_MarketingInfo.Remarks.ToString();
                    marketingPersonDropDownList.SelectedValue = aMRK_MarketingInfo.MarketingPersonId.ToString();
                }
            }
            catch (Exception ex)
            {
                string EID = Convert.ToString(((SessionUser)Session["SessionUser"]).EID);
                //LogController<HRM_SalaryIncrement_Details>.SetLog(ex, EID);
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }
Beispiel #3
0
 internal int UpdateMarketingInfo(MRK_MarketingInfo aMRK_MarketingInfo, int marketingInfoId)
 {
     return(aMarketingInfoDAL.UpdateMarketingInfo(marketingInfoId, aMRK_MarketingInfo));
 }
Beispiel #4
0
 public int SaveMarketingInfo(MRK_MarketingInfo aMRK_MarketingInfo)
 {
     return(aMarketingInfoDAL.SaveMarketingInfo(aMRK_MarketingInfo));
 }
 public int SaveMarketingInfo(MRK_MarketingInfo aMRK_MarketingInfo)
 {
     _context.MRK_MarketingInfo.AddObject(aMRK_MarketingInfo);
     _context.SaveChanges();
     return(1);
 }
Beispiel #6
0
        protected void submitButton_Click(object sender, EventArgs e)
        {
            try
            {
                //Reference---------------------------------
                if (referenceCheckBox.Checked == true)
                {
                    MRK_Reference aMRK_Reference = new MRK_Reference();
                    aMRK_Reference.ReferenceName   = referenceTextBox.Text;
                    aMRK_Reference.ReferenceNumber = "";
                    aMRK_Reference.Create_User     = ((SessionUser)Session["SessionUser"]).UserId;
                    aMRK_Reference.Create_Date     = DateTime.Now;
                    aMRK_Reference.OCODE           = ((SessionUser)Session["SessionUser"]).OCode;

                    currentReferenceId = aMarketingInfoBLL.Savereference(aMRK_Reference);
                }
                else
                {
                    currentReferenceId = Convert.ToInt32(referenceDropDownList.SelectedValue.ToString());
                }


                //Project-----------------------------------------
                if (projectCheckBox.Checked == true)
                {
                    MRK_Project aMRK_Project = new MRK_Project();
                    aMRK_Project.ProjectName = projectTextBox.Text;
                    aMRK_Project.Create_User = ((SessionUser)Session["SessionUser"]).UserId;
                    aMRK_Project.Create_Date = DateTime.Now;
                    aMRK_Project.OCODE       = ((SessionUser)Session["SessionUser"]).OCode;

                    currentProjectId = aMarketingInfoBLL.Saveproject(aMRK_Project);
                }
                else
                {
                    currentProjectId = Convert.ToInt32(projectDropDownList.SelectedValue.ToString());
                }



                if (visitDateTextBox.Text == "")
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Visit Date')", true);
                    return;
                }
                else if (clientNameTextBox.Text == "")
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Input Client Name!')", true);
                }
                else if (contactNumberTextBox.Text == "")
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Input Contact Number!')", true);
                }
                else if (projectDropDownList.Text == "--Select--")
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Project!')", true);
                }
                else if (stageDropDownList.Text == "--Select--")
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Stage!')", true);
                }
                else
                {
                    if (submitButton.Text == "Submit")
                    {
                        MRK_MarketingInfo aMRK_MarketingInfo = new MRK_MarketingInfo();
                        aMRK_MarketingInfo.VisitDate         = Convert.ToDateTime(visitDateTextBox.Text);
                        aMRK_MarketingInfo.Client            = clientNameTextBox.Text;
                        aMRK_MarketingInfo.ContactPerson     = contactPersonTextBox.Text;
                        aMRK_MarketingInfo.Designation       = designationTextBox.Text;
                        aMRK_MarketingInfo.ContactNumber     = contactNumberTextBox.Text;
                        aMRK_MarketingInfo.Email             = emailTextBox.Text;
                        aMRK_MarketingInfo.Address           = addressTextBox.Text;
                        aMRK_MarketingInfo.ProjectId         = currentProjectId;
                        aMRK_MarketingInfo.Module            = moduleTextBox.Text;
                        aMRK_MarketingInfo.StageId           = Convert.ToInt32(stageDropDownList.SelectedValue.ToString());
                        aMRK_MarketingInfo.MarketingPersonId = marketingPersonDropDownList.SelectedValue.ToString();
                        aMRK_MarketingInfo.ReferenceId       = currentReferenceId;
                        aMRK_MarketingInfo.Remarks           = remarksTextBox.Text;
                        aMRK_MarketingInfo.Create_User       = ((SessionUser)Session["SessionUser"]).UserId;
                        aMRK_MarketingInfo.Create_Date       = DateTime.Now;
                        aMRK_MarketingInfo.OCODE             = ((SessionUser)Session["SessionUser"]).OCode;

                        int result = aMarketingInfoBLL.SaveMarketingInfo(aMRK_MarketingInfo);


                        if (result == 1)
                        {
                            ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Saved Successfully')", true);
                        }
                    }
                    else if (submitButton.Text == "Update")
                    {
                        MRK_MarketingInfo aMRK_MarketingInfo = new MRK_MarketingInfo();
                        aMRK_MarketingInfo.VisitDate         = Convert.ToDateTime(visitDateTextBox.Text);
                        aMRK_MarketingInfo.Client            = clientNameTextBox.Text;
                        aMRK_MarketingInfo.ContactPerson     = contactPersonTextBox.Text;
                        aMRK_MarketingInfo.Designation       = designationTextBox.Text;
                        aMRK_MarketingInfo.ContactNumber     = contactNumberTextBox.Text;
                        aMRK_MarketingInfo.Email             = emailTextBox.Text;
                        aMRK_MarketingInfo.Address           = addressTextBox.Text;
                        aMRK_MarketingInfo.ProjectId         = currentProjectId;
                        aMRK_MarketingInfo.Module            = moduleTextBox.Text;
                        aMRK_MarketingInfo.StageId           = Convert.ToInt32(stageDropDownList.SelectedValue.ToString());
                        aMRK_MarketingInfo.MarketingPersonId = marketingPersonDropDownList.SelectedValue.ToString();
                        aMRK_MarketingInfo.ReferenceId       = currentReferenceId;
                        aMRK_MarketingInfo.Remarks           = remarksTextBox.Text;
                        aMRK_MarketingInfo.Edit_User         = ((SessionUser)Session["SessionUser"]).UserId;
                        aMRK_MarketingInfo.Edit_Date         = DateTime.Now;
                        aMRK_MarketingInfo.OCODE             = ((SessionUser)Session["SessionUser"]).OCode;

                        int marketingInfoId = Convert.ToInt16(hidMarketingInfoId.Value);
                        int result          = aMarketingInfoBLL.UpdateMarketingInfo(aMRK_MarketingInfo, marketingInfoId);
                        if (result == 1)
                        {
                            ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Updated Successfully')", true);
                            GetMarketingInfoGridView();
                            string OCODE = Convert.ToString(((SessionUser)Session["SessionUser"]).OCode);
                        }
                    }

                    ClearAllControl();


                    referenceCheckBox.Checked     = false;
                    referenceTextBox.Visible      = false;
                    referenceDropDownList.Visible = true;

                    projectCheckBox.Checked     = false;
                    projectTextBox.Visible      = false;
                    projectDropDownList.Visible = true;
                }
                GetMarketingInfoGridView();
            }
            catch (Exception ex)
            {
                string EID = Convert.ToString(((SessionUser)Session["SessionUser"]).EID);
                //LogController<officeSetup>.SetLog(ex, EID);
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }
Beispiel #7
0
        protected void imgbtnEdit_Click(object sender, ImageClickEventArgs e)
        {
            MRK_MarketingInfo aMRK_MarketingInfo = new MRK_MarketingInfo();
            ImageButton       imgbtn             = (ImageButton)sender;
            GridViewRow       row = (GridViewRow)imgbtn.NamingContainer;

            if (referenceCheckBox.Checked == true)
            {
                referenceCheckBox.Checked     = false;
                referenceTextBox.Visible      = false;
                referenceDropDownList.Visible = true;
            }

            if (projectCheckBox.Checked == true)
            {
                projectCheckBox.Checked     = false;
                projectTextBox.Visible      = false;
                projectDropDownList.Visible = true;
            }


            try
            {
                string marketingInfoIds = "";
                Label  lblMarketingInfo = (Label)marketingInfoGridView.Rows[row.RowIndex].FindControl("lblMarketingInfo");
                if (lblMarketingInfo != null)
                {
                    string OCODE = Convert.ToString(((SessionUser)Session["SessionUser"]).OCode);
                    marketingInfoIds = lblMarketingInfo.Text;

                    aMRK_MarketingInfo = aMarketingInfoBLL.GetMarketingInfoForEdit(marketingInfoIds, OCODE);

                    if (aMRK_MarketingInfo != null)
                    {
                        hidMarketingInfoId.Value                  = aMRK_MarketingInfo.MarketingInfoId.ToString();
                        visitDateTextBox.Text                     = aMRK_MarketingInfo.VisitDate.ToString();
                        clientNameTextBox.Text                    = aMRK_MarketingInfo.Client.ToString();
                        contactPersonTextBox.Text                 = aMRK_MarketingInfo.ContactPerson.ToString();
                        designationTextBox.Text                   = aMRK_MarketingInfo.Designation.ToString();
                        contactNumberTextBox.Text                 = aMRK_MarketingInfo.ContactNumber.ToString();
                        emailTextBox.Text                         = aMRK_MarketingInfo.Email.ToString();
                        addressTextBox.Text                       = aMRK_MarketingInfo.Address.ToString();
                        projectDropDownList.SelectedValue         = aMRK_MarketingInfo.ProjectId.ToString();
                        moduleTextBox.Text                        = aMRK_MarketingInfo.Module.ToString();
                        stageDropDownList.SelectedValue           = aMRK_MarketingInfo.StageId.ToString();
                        referenceDropDownList.SelectedValue       = aMRK_MarketingInfo.ReferenceId.ToString();
                        remarksTextBox.Text                       = aMRK_MarketingInfo.Remarks.ToString();
                        marketingPersonDropDownList.SelectedValue = aMRK_MarketingInfo.MarketingPersonId.ToString();


                        if (submitButton.Text == "Submit")
                        {
                            submitButton.Text = "Update";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string EID = Convert.ToString(((SessionUser)Session["SessionUser"]).EID);
                //LogController<HRM_SalaryIncrement_Details>.SetLog(ex, EID);
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }