private void MakeEmptyForm()
    {
        TxtCompanyName.Focus();
        if (!FlagAdd)
        {
            BtnSave.Visible = true;
        }
        BtnUpdate.Visible     = false;
        BtnDelete.Visible     = false;
        TxtCompanyName.Text   = string.Empty;
        Txtabbreviations.Text = string.Empty;
        TxtAddress.Text       = string.Empty;
        TxtPhoneNo.Text       = string.Empty;
        TxtEmail.Text         = string.Empty;
        TxtWebsite.Text       = string.Empty;
        TxtFaxNo.Text         = string.Empty;
        TxtTinNo.Text         = string.Empty;
        TxtVatNo.Text         = string.Empty;
        TxtServiceTaxNo.Text  = string.Empty;
        TxtNoteC.Text         = string.Empty;

        TxtSearch.Text = string.Empty;


        ReportGrid(StrCondition);
    }
Beispiel #2
0
    private void MakeEmptyForm()
    {
        TxtCompanyName.Focus();
        if (!FlagAdd)
        {
            BtnSave.Visible = true;
        }
        BtnUpdate.Visible       = false;
        BtnDelete.Visible       = false;
        TxtCompanyName.Text     = string.Empty;
        Txtabbreviations.Text   = string.Empty;
        TxtAddress.Text         = string.Empty;
        TxtPhoneNo.Text         = string.Empty;
        TxtEmail.Text           = string.Empty;
        TxtWebsite.Text         = string.Empty;
        TxtFaxNo.Text           = string.Empty;
        TxtTinNo.Text           = string.Empty;
        TxtVatNo.Text           = string.Empty;
        TxtServiceTaxNo.Text    = string.Empty;
        TxtNoteC.Text           = string.Empty;
        lblLogopath.Text        = "";
        LblSignPath.Text        = "";
        LblSignPath1.Text       = "";
        LblSignPath2.Text       = "";
        TxtSearch.Text          = string.Empty;
        ImgCompanyLogo.ImageUrl = "";
        ImgSign.ImageUrl        = "";
        ImgSign1.ImageUrl       = "";
        ImgSign2.ImageUrl       = "";

        SetInitialRow();
        ReportGrid(StrCondition);
    }
Beispiel #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            TxtClientCode.Text = code;

            TxtCompanyName.Focus();

            LoadClient();
        }
    protected void GrdReport_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        try
        {
            try
            {
                switch (e.CommandName)
                {
                case ("Select"):
                {
                    if (Convert.ToInt32(e.CommandArgument) != 0)
                    {
                        ViewState["EditID"] = Convert.ToInt32(e.CommandArgument);
                        DS = Obj_CM.GetCompanyForEdit(Convert.ToInt32(e.CommandArgument), out StrError);
                        if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
                        {
                            TxtCompanyName.Text   = DS.Tables[0].Rows[0]["CompanyName"].ToString();
                            Txtabbreviations.Text = DS.Tables[0].Rows[0]["abbreviation"].ToString();
                            TxtAddress.Text       = DS.Tables[0].Rows[0]["CAddress"].ToString();

                            TxtPhoneNo.Text      = DS.Tables[0].Rows[0]["PhoneNo"].ToString();
                            TxtEmail.Text        = DS.Tables[0].Rows[0]["EmailId"].ToString();
                            TxtWebsite.Text      = DS.Tables[0].Rows[0]["Website"].ToString();
                            TxtFaxNo.Text        = DS.Tables[0].Rows[0]["FaxNo"].ToString();
                            TxtTinNo.Text        = DS.Tables[0].Rows[0]["TinNo"].ToString();
                            TxtVatNo.Text        = DS.Tables[0].Rows[0]["VatNo"].ToString();
                            TxtServiceTaxNo.Text = DS.Tables[0].Rows[0]["ServiceTaxNo"].ToString();
                            TxtNoteC.Text        = DS.Tables[0].Rows[0]["Note"].ToString();
                        }
                        else
                        {
                            MakeEmptyForm();
                        }

                        DS     = null;
                        Obj_CM = null;
                        if (!FlagEdit)
                        {
                            BtnUpdate.Visible = true;
                        }
                        BtnSave.Visible = false;
                        if (!FlagDel)
                        {
                            BtnDelete.Visible = true;
                        }
                        TxtCompanyName.Focus();
                    }
                    break;
                }
                }
            }
            catch (Exception ex) { throw new Exception(ex.Message); }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
    //public void CallPagging()
    //{
    //    #region [Code For Pagging in Repeater]--------------------------------
    //    PageNumber = Convert.ToInt32(1);// Add For Pdgging by Piyush
    //    PagedDataSource pgitems = new PagedDataSource();
    //    DataTable dt = new DataTable();
    //    dt = (DataTable)ViewState["CurrentTable1"];
    //    System.Data.DataView dv = new System.Data.DataView(dt);
    //    pgitems.DataSource = dv;
    //    pgitems.AllowPaging = true;
    //    pgitems.PageSize = 16;
    //    pgitems.CurrentPageIndex = PageNumber;
    //    if (pgitems.PageCount > 1)
    //    {
    //        rptPages.Visible = true;
    //        System.Collections.ArrayList pages = new System.Collections.ArrayList();
    //        for (int i = 0; i < pgitems.PageCount; i++)
    //            pages.Add((i + 1).ToString());
    //        //Extra Code Here
    //        countPage = pgitems.PageCount;
    //        System.Collections.ArrayList pages1 = new System.Collections.ArrayList();
    //        for (int i = 0; i < 5; i++)
    //            pages1.Add((i + 1).ToString());
    //        //End Here
    //        rptPages.DataSource = pages1;
    //        rptPages.DataBind();
    //    }
    //    else
    //    {
    //        //GridDetails.Visible = false;
    //    }
    //    GrdReport.DataSource = pgitems;
    //    GrdReport.DataBind();

    //    ((LinkButton)rptPages.Controls[0].FindControl("btnPrev")).Visible = false;
    //    if ((pgitems.PageCount) <= 5)
    //    {
    //        ((LinkButton)rptPages.Controls[rptPages.Controls.Count - 1].FindControl("btnNext")).Visible = false;
    //    }
    //    #endregion [Code For Pagging in Repeater]--------------------------------
    //}
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        string StrError = "";
        int    InsertRow = 0, InsertRowDtls = 0;

        DS = Obj_CCMaster.ChkDuplicate(TxtCompanyName.Text.Trim(), out StrError);
        if (DS.Tables[0].Rows.Count > 0)
        {
            obj_Comman.ShowPopUpMsg("Record is Already Present..", this.Page);
            TxtCompanyName.Focus();
        }
        else
        {
            Entity_CCMaster.Action      = 1;
            Entity_CCMaster.CompanyName = TxtCompanyName.Text;
            Entity_CCMaster.SupplierFor = TxtSupplierFor.Text;
            Entity_CCMaster.Address     = TxtAddress.Text;
            Entity_CCMaster.WebUrl      = TxtWebsite.Text;
            Entity_CCMaster.Remark      = TxtRemark.Text;
            Entity_CCMaster.CreatedBy   = Convert.ToInt32(Session["UserId"]);
            Entity_CCMaster.CreatedDate = Convert.ToDateTime(DateTime.Now.ToShortDateString());
            Entity_CCMaster.IsDelete    = false;
            InsertRow = Obj_CCMaster.InsertRecord(ref Entity_CCMaster, StrError);
            if (InsertRow > 0)
            {
                if (ViewState["CurrentTable"] != null)
                {
                    DataTable dtInsert = new DataTable();
                    dtInsert = (DataTable)ViewState["CurrentTable"];
                    for (int i = 0; i < dtInsert.Rows.Count; i++)
                    {
                        Entity_CCMaster.ClientCompanyId = InsertRow;
                        Entity_CCMaster.PersonName      = dtInsert.Rows[i]["PersonName"].ToString();
                        //Entity_CCMaster.Address = dtInsert.Rows[i]["Address"].ToString();
                        Entity_CCMaster.Designation = dtInsert.Rows[i]["Designation"].ToString();
                        Entity_CCMaster.ContactNo1  = dtInsert.Rows[i]["ContactNo1"].ToString();
                        Entity_CCMaster.ContactNo2  = dtInsert.Rows[i]["ContactNo2"].ToString();
                        Entity_CCMaster.EmailId1    = dtInsert.Rows[i]["EmailId1"].ToString();
                        Entity_CCMaster.EmailId2    = dtInsert.Rows[i]["EmailId2"].ToString();
                        Entity_CCMaster.Note        = dtInsert.Rows[i]["Note"].ToString();
                        InsertRowDtls = Obj_CCMaster.InsertDertailsRecord(ref Entity_CCMaster, StrError);
                    }
                    if (InsertRowDtls > 0)
                    {
                        obj_Comman.ShowPopUpMsg("Record Saved Successfully", this.Page);
                        EmptyFormFields();
                        EmptyMasterForm();
                        setInitialRow();
                        ReportGrid(StrCondition);
                    }
                }
            }
        }
    }
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int InsertRow = 0, InsertRowDtls = 0;

        try
        {
            if (ChkDetails() == true)
            {
                DS = Obj_CM.ChkDuplicate(TxtCompanyName.Text.Trim(), out StrError);
                if (DS.Tables[0].Rows.Count > 0)
                {
                    obj_Comm.ShowPopUpMsg("Record is Already Present..", this.Page);
                    TxtCompanyName.Focus();
                }
                else
                {
                    Entity_CM.CompanyName  = TxtCompanyName.Text;
                    Entity_CM.abbreviation = Txtabbreviations.Text;
                    Entity_CM.CAddress     = TxtAddress.Text;

                    Entity_CM.PhoneNo      = TxtPhoneNo.Text.Trim();
                    Entity_CM.EmailId      = TxtEmail.Text.Trim();
                    Entity_CM.Website      = TxtWebsite.Text.Trim();
                    Entity_CM.FaxNo        = TxtFaxNo.Text.Trim();
                    Entity_CM.TinNo        = TxtTinNo.Text.Trim();
                    Entity_CM.VatNo        = TxtVatNo.Text.Trim();
                    Entity_CM.ServiceTaxNo = TxtServiceTaxNo.Text.Trim();
                    Entity_CM.Note         = TxtNoteC.Text.Trim();

                    Entity_CM.UserId    = Convert.ToInt32(Session["UserId"]);
                    Entity_CM.LoginDate = DateTime.Now;

                    InsertRow = Obj_CM.InsertRecord(ref Entity_CM, out StrError);

                    if (InsertRow > 0)
                    {
                        obj_Comm.ShowPopUpMsg("Record Saved Successfully", this.Page);

                        MakeEmptyForm();
                        Entity_CM = null;
                        Obj_CM    = null;
                    }
                }
            }
            else
            {
                obj_Comm.ShowPopUpMsg("Please Enter Details ..!", this.Page);
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
 public void EmptyMasterForm()
 {
     TxtCompanyName.Text = string.Empty;
     TxtSupplierFor.Text = string.Empty;
     TxtAddress.Text     = string.Empty;
     TxtWebsite.Text     = string.Empty;
     TxtRemark.Text      = string.Empty;
     TxtCompanyName.Focus();
     BtnSave.Visible   = true;
     BtnMail.Visible   = BtnUpdate.Visible = false;
     BtnDelete.Visible = false;
 }
Beispiel #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack == false)
     {
         LblDuplicateCompanyName.Visible = false;
         TxtCompanyName.Focus();
         this.Form.DefaultButton = BtnAddCompany.UniqueID;
         DataTable ObjIndustryTable = MyJobPortalModel.Industry.GetIndustryRecords("status='Active'");
         DdlIndustryName.DataSource = ObjIndustryTable;
         DdlIndustryName.DataBind();
         DdlIndustryName.Items.Insert(0, new ListItem("--Select--", "--Select--"));
         DataTable ObjCountryTable = MyJobPortalModel.Country.GetCountryRecords("status='Active'");
         DdlCountry.DataSource = ObjCountryTable;
         DdlCountry.DataBind();
         DdlCountry.Items.Insert(0, new ListItem("--Select Country--", "--Select--"));
         DdlState.Items.Add(new ListItem("--Select State--", "--Select--"));
         DdlCity.Items.Add(new ListItem("--Select City--", "--Select--"));
     }
 }
 protected void BtnUpdateCompany_Click(object sender, EventArgs e)
 {
     if (this.IsValid == true)
     {
         if (MyJobPortalModel.CompanyDetails.GetCompanyDetailsRecords("CompanyName='" + TxtCompanyName.Text + "' and Id<>" + Request.QueryString["Id"]).Rows.Count > 0)
         {
             LblDuplicateCompanyError.Visible = true;
             TxtCompanyName.Focus();
             return;
         }
         MyJobPortalModel.CompanyDetails ObjCompany = new MyJobPortalModel.CompanyDetails(int.Parse(Request.QueryString["Id"]));
         ObjCompany.CompanyName = TxtCompanyName.Text;
         ObjCompany.WebsiteURL  = TxtWebsiteURL.Text;
         ObjCompany.IndustryID  = int.Parse(DdlIndustry.SelectedValue);
         ObjCompany.Description = TxtDescription.Text;
         ObjCompany.Status      = DdlStatus.SelectedValue;
         ObjCompany.Update();
         EditCompanyModal.Visible = false;
         Response.Redirect("ViewCompany.aspx?Id=" + Request.QueryString["Id"]);
     }
 }
    protected void GrdReport_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        try
        {
            switch (e.CommandName)
            {
            case ("Select"):
            {
                if (Convert.ToInt32(e.CommandArgument) != 0)
                {
                    BtnSave.Visible     = false;
                    BtnDelete.Visible   = true;
                    BtnMail.Visible     = BtnUpdate.Visible = true;
                    ViewState["EditID"] = Convert.ToInt32(e.CommandArgument);
                    Ds = Obj_CCMaster.GetItemForEdit(Convert.ToInt32(e.CommandArgument), out StrError);
                    if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
                    {
                        TxtCompanyName.Text = Ds.Tables[0].Rows[0]["Name"].ToString();
                        TxtSupplierFor.Text = Ds.Tables[0].Rows[0]["SupplierFor"].ToString();
                        TxtAddress.Text     = Ds.Tables[0].Rows[0]["Address"].ToString();
                        TxtWebsite.Text     = Ds.Tables[0].Rows[0]["WebSite"].ToString();
                        TxtRemark.Text      = Ds.Tables[0].Rows[0]["Remark"].ToString();
                        TxtCompanyName.Focus();
                    }
                    else
                    {
                        setInitialRow();
                        EmptyFormFields();
                    }
                    if (Ds.Tables[1].Rows.Count > 0)
                    {
                        ViewState["CurrentTable"] = Ds.Tables[1];
                        GridDetails.DataSource    = Ds.Tables[1];
                        GridDetails.DataBind();
                        //TxtPersonName.Focus();
                    }
                    else
                    {
                        setInitialRow();
                        //EmptyFormFields();
                    }
                }
                break;
            }

            case ("MAIL"):
            {
                GETDATAFORMAIL(2, Convert.ToInt32(e.CommandArgument), 0);
                MDPopUpYesNoMail.Show();
                BtnPopMail.Focus();
                break;
            }

            case ("MAILDetails"):
            {
                GETDATAFORMAIL(2, Convert.ToInt32(e.CommandArgument), 1);
                MDPopUpYesNoMail.Show();
                BtnPopMail.Focus();
                break;
            }
            }
        }
        catch (Exception ex) { throw new Exception(ex.Message); }
    }
Beispiel #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     TxtCompanyName.Focus();
     this.Form.DefaultButton = BtnGo.UniqueID;
     ShowGridView();
 }
Beispiel #12
0
 protected void GrdReport_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     try
     {
         try
         {
             switch (e.CommandName)
             {
             case ("Select"):
             {
                 if (Convert.ToInt32(e.CommandArgument) != 0)
                 {
                     ViewState["EditID"] = Convert.ToInt32(e.CommandArgument);
                     DS = Obj_CM.GetCompanyForEdit(Convert.ToInt32(e.CommandArgument), out StrError);
                     if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
                     {
                         TxtCompanyName.Text     = DS.Tables[0].Rows[0]["CompanyName"].ToString();
                         Txtabbreviations.Text   = DS.Tables[0].Rows[0]["abbreviation"].ToString();
                         TxtAddress.Text         = DS.Tables[0].Rows[0]["CAddress"].ToString();
                         lblLogopath.Text        = DS.Tables[0].Rows[0]["CLogo"].ToString();
                         ImgCompanyLogo.ImageUrl = lblLogopath.Text;
                         TxtPhoneNo.Text         = DS.Tables[0].Rows[0]["PhoneNo"].ToString();
                         TxtEmail.Text           = DS.Tables[0].Rows[0]["EmailId"].ToString();
                         TxtWebsite.Text         = DS.Tables[0].Rows[0]["Website"].ToString();
                         TxtFaxNo.Text           = DS.Tables[0].Rows[0]["FaxNo"].ToString();
                         TxtTinNo.Text           = DS.Tables[0].Rows[0]["TinNo"].ToString();
                         TxtVatNo.Text           = DS.Tables[0].Rows[0]["VatNo"].ToString();
                         TxtServiceTaxNo.Text    = DS.Tables[0].Rows[0]["ServiceTaxNo"].ToString();
                         LblSignPath.Text        = DS.Tables[0].Rows[0]["DigitalSignature"].ToString();
                         LblSignPath1.Text       = DS.Tables[0].Rows[0]["DigitalSignature1"].ToString();
                         LblSignPath2.Text       = DS.Tables[0].Rows[0]["DigitalSignature2"].ToString();
                         ImgSign.ImageUrl        = LblSignPath.Text;
                         ImgSign1.ImageUrl       = LblSignPath1.Text;
                         ImgSign2.ImageUrl       = LblSignPath2.Text;
                         TxtNoteC.Text           = DS.Tables[0].Rows[0]["Note"].ToString();
                     }
                     else
                     {
                         MakeEmptyForm();
                     }
                     if (DS.Tables[1].Rows.Count > 0)
                     {
                         GridDetails.DataSource = DS.Tables[1];
                         GridDetails.DataBind();
                         ViewState["CurrentTable"] = DS.Tables[1];
                     }
                     else
                     {
                         SetInitialRow();
                     }
                     DS     = null;
                     Obj_CM = null;
                     if (!FlagEdit)
                     {
                         BtnUpdate.Visible = true;
                     }
                     BtnSave.Visible = false;
                     if (!FlagDel)
                     {
                         BtnDelete.Visible = true;
                     }
                     TxtCompanyName.Focus();
                     MakeControlEmpty();
                 }
                 break;
             }
             }
         }
         catch (Exception ex) { throw new Exception(ex.Message); }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Beispiel #13
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int InsertRow = 0, InsertRowDtls = 0;

        try
        {
            if (ChkDetails() == true)
            {
                DS = Obj_CM.ChkDuplicate(TxtCompanyName.Text.Trim(), out StrError);
                if (DS.Tables[0].Rows.Count > 0)
                {
                    obj_Comm.ShowPopUpMsg("Record is Already Present..", this.Page);
                    TxtCompanyName.Focus();
                }
                else
                {
                    Entity_CM.CompanyName  = TxtCompanyName.Text;
                    Entity_CM.abbreviation = Txtabbreviations.Text;
                    Entity_CM.CAddress     = TxtAddress.Text;
                    if (!string.IsNullOrEmpty(lblLogopath.Text))
                    {
                        Entity_CM.CLogo = lblLogopath.Text;
                    }
                    else
                    {
                        Entity_CM.CLogo = "";
                    }
                    Entity_CM.PhoneNo      = TxtPhoneNo.Text.Trim();
                    Entity_CM.EmailId      = TxtEmail.Text.Trim();
                    Entity_CM.Website      = TxtWebsite.Text.Trim();
                    Entity_CM.FaxNo        = TxtFaxNo.Text.Trim();
                    Entity_CM.TinNo        = TxtTinNo.Text.Trim();
                    Entity_CM.VatNo        = TxtVatNo.Text.Trim();
                    Entity_CM.ServiceTaxNo = TxtServiceTaxNo.Text.Trim();
                    if (!string.IsNullOrEmpty(LblSignPath.Text))
                    {
                        Entity_CM.DigitalSignature = LblSignPath.Text;
                    }
                    else
                    {
                        Entity_CM.DigitalSignature = "";
                    }

                    if (!string.IsNullOrEmpty(LblSignPath1.Text))
                    {
                        Entity_CM.DigitalSignature1 = LblSignPath1.Text;
                    }
                    else
                    {
                        Entity_CM.DigitalSignature1 = "";
                    }

                    if (!string.IsNullOrEmpty(LblSignPath2.Text))
                    {
                        Entity_CM.DigitalSignature2 = LblSignPath2.Text;
                    }
                    else
                    {
                        Entity_CM.DigitalSignature2 = "";
                    }
                    Entity_CM.Note      = TxtNoteC.Text.Trim();
                    Entity_CM.UserId    = Convert.ToInt32(Session["UserId"]);
                    Entity_CM.LoginDate = DateTime.Now;

                    InsertRow = Obj_CM.InsertRecord(ref Entity_CM, out StrError);

                    if (InsertRow > 0)
                    {
                        if (ViewState["CurrentTable"] != null)
                        {
                            DataTable dtInsert = new DataTable();
                            dtInsert = (DataTable)ViewState["CurrentTable"];
                            for (int i = 0; i < dtInsert.Rows.Count; i++)
                            {
                                Entity_CM.CompanyId = InsertRow;
                                Entity_CM.BankId    = Convert.ToInt32(dtInsert.Rows[i]["BankId"].ToString());
                                Entity_CM.AccountNo = dtInsert.Rows[i]["AccountNo"].ToString();
                                Entity_CM.NoteB     = dtInsert.Rows[i]["NoteB"].ToString();
                                InsertRowDtls       = Obj_CM.InsertDetailsRecord(ref Entity_CM, out StrError);
                            }
                        }
                        if (InsertRow > 0)
                        {
                            obj_Comm.ShowPopUpMsg("Record Saved Successfully", this.Page);
                            MakeControlEmpty();
                            MakeEmptyForm();
                            Entity_CM = null;
                            Obj_CM    = null;
                        }
                    }
                }
            }
            else
            {
                obj_Comm.ShowPopUpMsg("Please Enter Details ..!", this.Page);
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }