예제 #1
0
    protected void BtnDelete_Click(object sender, EventArgs e)
    {
        int DeleteId = 0;

        try
        {
            if (ViewState["EditID"] != null)
            {
                DeleteId = Convert.ToInt32(ViewState["EditID"]);
            }
            if (DeleteId != 0)
            {
                Entity_CM.CompanyId = DeleteId;
                Entity_CM.UserId    = Convert.ToInt32(Session["UserID"]);
                Entity_CM.LoginDate = DateTime.Now;

                int iDelete = Obj_CM.DeleteRecord(ref Entity_CM, out StrError);
                if (iDelete != 0)
                {
                    obj_Comm.ShowPopUpMsg("Record Deleted Successfully..!", this.Page);
                    MakeEmptyForm();
                }
            }
            Entity_CM = null;
            Obj_CM    = null;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
예제 #2
0
    public static string[] GetCompletionList(string prefixText, int count, string contextKey)
    {
        DMCompanyMaster Obj_CM = new DMCompanyMaster();

        String[] SearchList = Obj_CM.GetSuggestRecord(prefixText);
        return(SearchList);
    }
예제 #3
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();

                            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);
        }
    }
예제 #4
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;

                    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);
        }
    }
예제 #5
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0, InsertRowDtls = 0;

        try
        {
            if (ChkDetails() == true)
            {
                if (ViewState["EditID"] != null)
                {
                    Entity_CM.CompanyId = Convert.ToInt32(ViewState["EditID"]);
                }
                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;

                UpdateRow = Obj_CM.UpdateRecord(ref Entity_CM, out StrError);

                if (UpdateRow > 0)
                {
                    obj_Comm.ShowPopUpMsg("Record Updated 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);
        }
    }
예제 #6
0
 public void ReportGrid(string RepCondition)
 {
     try
     {
         DS = Obj_CM.GetCompanyDtls(RepCondition, out StrError);
         if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
         {
             GrdReport.DataSource = DS.Tables[0];
             GrdReport.DataBind();
         }
         else
         {
             GrdReport.DataSource = null;
             GrdReport.DataBind();
         }
         Obj_CM = null;
         DS     = null;
     }
     catch (Exception ex) { throw new Exception(ex.Message); }
 }
예제 #7
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);
     }
 }
예제 #8
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0, InsertRowDtls = 0;

        try
        {
            if (ChkDetails() == true)
            {
                if (ViewState["EditID"] != null)
                {
                    Entity_CM.CompanyId = Convert.ToInt32(ViewState["EditID"]);
                }
                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;

                UpdateRow = Obj_CM.UpdateRecord(ref Entity_CM, out StrError);

                if (UpdateRow > 0)
                {
                    if (ViewState["CurrentTable"] != null)
                    {
                        DataTable dtInsert = new DataTable();
                        dtInsert = (DataTable)ViewState["CurrentTable"];
                        for (int i = 0; i < dtInsert.Rows.Count; i++)
                        {
                            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 (UpdateRow > 0)
                    {
                        obj_Comm.ShowPopUpMsg("Record Updated 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);
        }
    }