Exemplo n.º 1
0
    public static string LoadNUMBER(string frmt, string tbl, string col, SqlConnection Con, string BranchID)
    {
        string vNO   = "";
        string vDate = "";
        string mm1   = System.DateTime.Now.Month.ToString();
        string yy1   = System.DateTime.Now.Year.ToString();
        //SqlConnection Con = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        DataSet dsDATE = AACommon.ReturnDatasetBySP("Get_CurrentDate", Con, null);

        if (dsDATE.Tables[0].Rows.Count > 0)
        {
            mm1   = dsDATE.Tables[0].Rows[0]["MM"].ToString();
            yy1   = dsDATE.Tables[0].Rows[0]["YY"].ToString();
            vDate = mm1 + "/" + dsDATE.Tables[0].Rows[0]["DD"].ToString() + "/" + yy1;
        }
        dsDATE.Dispose();
        yy1 = Convert.ToString(Convert.ToInt32(yy1) - 2000);

        if (mm1.Length == 1)
        {
            mm1 = "0" + mm1;
        }
        if (yy1.Length == 1)
        {
            yy1 = "0" + yy1;
        }
        string format1 = frmt + "-" + BranchID + "-" + mm1 + "-" + yy1 + "-";

        vNO = AACommon.GetAlphaNumericIDSIX(tbl, format1, col, Con);
        vNO = vNO + "`" + vDate;
        return(vNO);
    }
Exemplo n.º 2
0
    public static string InsertRegion(string UnitTitle, string DisplayName, string UnitTypeID, string IsBase, string BaseMultiplier, string UserID)
    {
        string        retMessage       = string.Empty;
        string        msg              = "";
        SqlConnection Conn             = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        string        ID               = AACommon.GetAlphaNumericIDSIX("ITM_UNIT", "UN-", "UnitID", Conn);
        SqlParameter  UnitID_P         = new SqlParameter("@UnitID", ID);
        SqlParameter  UnitTypeDesc_P   = new SqlParameter("@UnitTitle", UnitTitle);
        SqlParameter  DisplayName_P    = new SqlParameter("@DisplayName", DisplayName);
        SqlParameter  UnitTypeID_P     = new SqlParameter("@UnitTypeID", UnitTypeID);
        SqlParameter  IsBase_P         = new SqlParameter("@IsBase", IsBase);
        SqlParameter  BaseMultiplier_P = new SqlParameter("@BaseMultiplier", BaseMultiplier);
        SqlParameter  CREATEBY         = new SqlParameter("@CreateBy", UserID);

        msg = AACommon.Execute("ITM_UNIT_Insert", Conn, UnitID_P, UnitTypeDesc_P, DisplayName_P, UnitTypeID_P, IsBase_P, BaseMultiplier_P, CREATEBY);


        if (msg == "Record Saved Successfully")
        {
            retMessage = "true";
        }
        else
        {
            retMessage = "false";
        }

        return(retMessage);
    }
Exemplo n.º 3
0
    public static string InsertRegion(string AreaTitle, string TalukaID, string UserID)
    {
        string        retMessage     = string.Empty;
        string        msg            = "";
        SqlConnection Conn           = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        string        ID             = AACommon.GetAlphaNumericIDSIX("Area", "AR-", "AreaID", Conn);
        SqlParameter  UnitID_P       = new SqlParameter("@AreaID", ID);
        SqlParameter  UnitTypeDesc_P = new SqlParameter("@AreaTitle", AreaTitle);
        SqlParameter  UnitTypeID_P   = new SqlParameter("@TalukaID", TalukaID);
        SqlParameter  CREATEBY       = new SqlParameter("@CreateBy", UserID);

        msg = AACommon.Execute("SP_Area_Insert", Conn, UnitID_P, UnitTypeDesc_P, UnitTypeID_P, CREATEBY);


        if (msg == "Record Saved Successfully")
        {
            retMessage = "true";
        }
        else
        {
            retMessage = "false";
        }

        return(retMessage);
    }
Exemplo n.º 4
0
    public static string InsertRegion(string ITEMName, string ItemCode, string BarCode, string Discription, string Loose, string LoosePrice, string Strip, string StripPrice, string Box, string BoxPrice, string Carton, string CartonPrice, string UserID, string UnitTypeID, string Category, string Brand, string BranchID)
    {
        string        retMessage    = string.Empty;
        string        msg           = "";
        SqlConnection Conn          = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        string        ID            = AACommon.GetAlphaNumericIDSIX("ITM_ITEM", "ITM-", "ITEMID", Conn);
        SqlParameter  ITEMID_P      = new SqlParameter("@ITEMID", ID);
        SqlParameter  ITEMName_P    = new SqlParameter("@ITEMName", ITEMName);
        SqlParameter  ItemCode_P    = new SqlParameter("@ItemCode", ItemCode);
        SqlParameter  BarCode_P     = new SqlParameter("@BarCode", BarCode);
        SqlParameter  Discription_P = new SqlParameter("@Discription", Discription);
        SqlParameter  Loose_P       = new SqlParameter("@Loose", Loose);
        SqlParameter  LoosePrice_P  = new SqlParameter("@LoosePrice", LoosePrice);
        SqlParameter  Strip_P       = new SqlParameter("@Strip", Strip);
        SqlParameter  StripPrice_P  = new SqlParameter("@StripPrice", StripPrice);
        SqlParameter  Box_P         = new SqlParameter("@Box", Box);
        SqlParameter  BoxPrice_P    = new SqlParameter("@BoxPrice", BoxPrice);
        SqlParameter  Carton_P      = new SqlParameter("@Carton", Carton);
        SqlParameter  CartonPrice_P = new SqlParameter("@CartonPrice", CartonPrice);
        SqlParameter  CREATEBY      = new SqlParameter("@CreateBy", UserID);
        SqlParameter  IsSale_P      = new SqlParameter("@IsSale", "1");
        SqlParameter  IsPurchase_P  = new SqlParameter("@IsPurchase", "0");
        SqlParameter  UnitTypeID_P  = new SqlParameter("@UnitTypeID", UnitTypeID);
        SqlParameter  CatID         = new SqlParameter("@CatID", Category);
        SqlParameter  BrandID       = new SqlParameter("@BrandID", Brand);
        SqlParameter  Branch        = new SqlParameter("@BranchID", BranchID);


        //isale=1
        //ispurchase=0

        msg = AACommon.Execute("ITM_ITEM_INSERT", Conn, ITEMID_P, ITEMName_P, ItemCode_P, BarCode_P, Discription_P, Loose_P, LoosePrice_P, Strip_P, StripPrice_P, Box_P, BoxPrice_P, Carton_P, CartonPrice_P, CREATEBY, IsSale_P, IsPurchase_P, UnitTypeID_P, CatID, BrandID, Branch);


        if (msg == "Record Saved Successfully")
        {
            retMessage = "true";
        }
        else
        {
            retMessage = "false";
        }

        return(retMessage);
    }
Exemplo n.º 5
0
    public static string InsertRegion(string ITEMName, string ItemCode, string BarCode, string Discription, string UserID, string UnitTypeID, string DistPerc, string TradePrice, string RetailPrice, string PackingTypeID, string txtWt)

    {
        string        retMessage       = string.Empty;
        string        msg              = "";
        SqlConnection Conn             = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        string        ID               = AACommon.GetAlphaNumericIDSIX("ITM_ITEM", "ITM-", "ITEMID", Conn);
        SqlParameter  ITEMID_P         = new SqlParameter("@ITEMID", ID);
        SqlParameter  ITEMName_P       = new SqlParameter("@ITEMName", ITEMName);
        SqlParameter  ItemCode_P       = new SqlParameter("@ItemCode", ItemCode);
        SqlParameter  BarCode_P        = new SqlParameter("@BarCode", BarCode);
        SqlParameter  Discription_P    = new SqlParameter("@Discription", Discription);
        SqlParameter  CREATEBY         = new SqlParameter("@CreateBy", UserID);
        SqlParameter  IsSale_P         = new SqlParameter("@IsSale", "1");
        SqlParameter  IsPurchase_P     = new SqlParameter("@IsPurchase", "1");
        SqlParameter  UnitTypeID_P     = new SqlParameter("@UnitTypeID", UnitTypeID);
        SqlParameter  DistPercentage_P = new SqlParameter("@DistPercentage", DistPerc);
        SqlParameter  TradePrice_P     = new SqlParameter("@TradePrice", TradePrice);
        SqlParameter  RetailPrice_P    = new SqlParameter("@RetailPrice", RetailPrice);
        SqlParameter  PackingTypeID_P  = new SqlParameter("@PackingTypeID", PackingTypeID);
        SqlParameter  Wt               = new SqlParameter("@Wt", txtWt);



        //isale=1
        //ispurchase=0

        msg = AACommon.Execute("ITM_ITEM_INSERT_V2", Conn, ITEMID_P, ITEMName_P, ItemCode_P, BarCode_P, Discription_P, CREATEBY, IsSale_P, IsPurchase_P, UnitTypeID_P, DistPercentage_P, TradePrice_P, RetailPrice_P, PackingTypeID_P, Wt);


        if (msg == "Record Saved Successfully")
        {
            retMessage = "true";
        }
        else
        {
            retMessage = "false";
        }

        return(retMessage);
    }
Exemplo n.º 6
0
    public static string InsertRegion(string DeedTitle, string UserID)
    {
        string        retMessage      = string.Empty;
        string        msg             = "";
        SqlConnection Conn            = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        string        ID              = AACommon.GetAlphaNumericIDSIX("Deed", "DEED-", "DeedID", Conn);
        SqlParameter  DistrictID_P    = new SqlParameter("@DeedID", ID);
        SqlParameter  DistrictTitle_P = new SqlParameter("@DeedTitle", DeedTitle);
        SqlParameter  CREATEBY        = new SqlParameter("@CreateBy", UserID);

        msg = AACommon.Execute("SP_Deed_Insert", Conn, DistrictID_P, DistrictTitle_P, CREATEBY);


        if (msg == "Record Saved Successfully")
        {
            retMessage = "true";
        }
        else
        {
            retMessage = "false";
        }

        return(retMessage);
    }
Exemplo n.º 7
0
    public static string InsertRegion(string Packing, string UserID)
    {
        string        retMessage        = string.Empty;
        string        msg               = "";
        SqlConnection Conn              = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        string        ID                = AACommon.GetAlphaNumericIDSIX("ITEM_Packing", "PACK-", "PackingTypeID", Conn);
        SqlParameter  PackingTypeID_P   = new SqlParameter("@PackingTypeID", ID);
        SqlParameter  PackingTypeDesc_P = new SqlParameter("@PackingTypeDesc", Packing);
        SqlParameter  CREATEBY          = new SqlParameter("@CreateBy", UserID);

        msg = AACommon.Execute("ITEM_Packing_Insert", Conn, PackingTypeID_P, PackingTypeDesc_P, CREATEBY);


        if (msg == "Record Saved Successfully")
        {
            retMessage = "true";
        }
        else
        {
            retMessage = "false";
        }

        return(retMessage);
    }
Exemplo n.º 8
0
    public static string InsertRegion(string UnitType, string UserID, string BranchID)
    {
        string        retMessage = string.Empty;
        SqlConnection Conn       = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        string        ID         = AACommon.GetAlphaNumericIDSIX("Category", "CAT-", "CatID", Conn);
        SqlCommand    cmd        = new SqlCommand("insert into Category (CatID,CatTitle,CreateBy,BranchID) values ('" + ID + "','" + UnitType + "','" + UserID + "','" + BranchID + "')", Conn);

        Conn.Open();
        int a = cmd.ExecuteNonQuery();

        Conn.Close();


        if (a == 1)
        {
            retMessage = "true";
        }
        else
        {
            retMessage = "false";
        }

        return(retMessage);
    }
Exemplo n.º 9
0
    public static string InsertRegion(string DistrictName, string LoginIDString, string PasswordString, string EmailString, string PhoneString, string ManagerIDString, string UTIDString, string image, string UUserID, string BranchID)
    {
        string        retMessage = string.Empty;
        string        msg        = "";
        SqlConnection Conn       = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        string        ID         = AACommon.GetAlphaNumericIDSIX("USERS", "USR-", "UserID", Conn);
        string        ImageID    = ID;
        //string Pic_Path = HttpContext.Current.Server.MapPath("~/Images/UserImages/");
        //string fileNameWitPath = Pic_Path + ImageID + ".jpg";
        //using (FileStream fs = new FileStream(Pic_Path, FileMode.Create))
        //{
        //    using (BinaryWriter bw = new BinaryWriter(fs))
        //    {
        //        byte[] data = Convert.FromBase64String(image);
        //        bw.Write(data);
        //        bw.Close();
        //    }
        //}

        string path            = HttpContext.Current.Server.MapPath("~/Images/UserImages/");
        string fileNameWitPath = path + ImageID + ".jpg";

        ImageID = ImageID + ".jpg";
        if (image != "No Image")
        {
            using (FileStream fs = new FileStream(fileNameWitPath, FileMode.Create))
            {
                using (BinaryWriter bw = new BinaryWriter(fs))
                {
                    byte[] data = Convert.FromBase64String(image);

                    bw.Write(data);

                    bw.Close();
                }
            }
        }
        else
        {
            image = "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCABaAFoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD7YooooAKKKms7S5v7mOztIzJNKwVFHc/0HvQBDVqz0vUtQOLGwnn944yR+fSvSdA8B6XpiJNfxpd3XUlhmNT/ALKn+ZrplVUUKqgAdAOgoA8euvCWuWFo99fW8VvEgyfMmUHPoADyfaseva9b0Sy16zNnfKxUHejKcMjeo/PvXlPiHw9e+HroQ3WHicZhmUYDj09j6igDKooooAKKKKACiiigArtPhhbxvqV5cMoLRQqF9txOf5CuLrvPhaP3mot/sxD9WoA7+iiigArC8bWsV14bvfMUEwx+ah/usp6/zH41u1keK/8AkXNS/wCvZ/5UAeN0UUUAFFFFABRRRQAV6P8ADOwSLTZ9RWZma4fy2QjhdmcY+ua84r0D4Y6lGYLrSGyJFf7QnoVOAfyIH50Ad3RRRQAVT1ex/tLTLmxMvlCeJkL7c7c98d6uVm+IdSi0nR7q8lJ+WMqgHUueFH50AeLdCeeneigcKB6CigAooooAKKKKACtnwlqsOka9b3Vy22FsxSHsA3GT9Disakb7p+lAHvYIYAg5Bpap6PF5Ok2cJBylvGD/AN8irlABXBfE3VoytvosTZfPny47DooP6n8BXeHpXkHjZs+KL8A9GQYz/sLQBiUUUUAFFFFABRSEgDJNa+keFta1rD2dpthP/LaX5U/DufwoAya6b4faV/aGufaJoFkgtELNvXI3Hhf6n8K6bSfhxpdptk1ORr2Qclfuxj8ByfxNdVBbW9rEsNtAkUa9FRQAPwFAEnA4FLRRQAVwvxN00fZ7bVooV/dsY5mA5w33SfoQR+Nd1TWVXBV1BBGCCM5FAHg3vRXrGreA9B1LdJFbmzmPO+DgZ916GuM1fwDrembpLZVvoRzmIYcD3X/DNAHNUUrKyMUdSrA4IIwR+FJQB6h4f8A6bpgS51FVvLoc/MMxofZe/wBTXVBQMYGMdKB0paACiiigAooooAKKKKACkxmlooAydZ8M6Pri/wCmWoEuMCZPlkH49/oc1yD/AAuv97eXq8GzJ27ojnHbPPWvRaKAP//Z";
            using (FileStream fs = new FileStream(fileNameWitPath, FileMode.Create))
            {
                using (BinaryWriter bw = new BinaryWriter(fs))
                {
                    byte[] data = Convert.FromBase64String(image);

                    bw.Write(data);

                    bw.Close();
                }
            }
        }

        PasswordString = Encryption.Encrypt(PasswordString);
        SqlParameter UserID    = new SqlParameter("@UserID", ID);
        SqlParameter UserName  = new SqlParameter("@UserName", DistrictName);
        SqlParameter loginID   = new SqlParameter("@loginID", LoginIDString);
        SqlParameter Password  = new SqlParameter("@Password", PasswordString);
        SqlParameter email     = new SqlParameter("@email", EmailString);
        SqlParameter Phone     = new SqlParameter("@Phone", PhoneString);
        SqlParameter Picture   = new SqlParameter("@Picture", ImageID);
        SqlParameter ManagerID = new SqlParameter("@ManagerID", ManagerIDString);
        SqlParameter UTID      = new SqlParameter("@UTID", UTIDString);
        SqlParameter CREATEBY  = new SqlParameter("@CREATEBY", UUserID);
        SqlParameter Branch    = new SqlParameter("@BranchID", BranchID);

        msg = AACommon.Execute("USER_INSERT", Conn, UserID, UserName, loginID, Password, email, Phone, Picture, ManagerID, UTID, CREATEBY, Branch);


        if (msg == "Record Saved Successfully")
        {
            retMessage = "true";
        }
        else
        {
            retMessage = "false";
        }

        return(retMessage);
    }
Exemplo n.º 10
0
    public static string InsertRegion(string SupplierTitle, string SupplierCode, string Phone, string Fax, string Email, string AddressLine1, string AddressLine2, string NTN, string GST, string SRB, string opBal, string UserID)
    {
        string        retMessage = string.Empty;
        string        msg        = "";
        SqlConnection Conn       = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        SqlConnection ConACC     = new SqlConnection(ConfigurationManager.ConnectionStrings["ConACC"].ConnectionString);

        string       ID              = AACommon.GetAlphaNumericIDSIX("Supplier", "SIP-", "SupplierID", Conn);
        SqlParameter SupplierID_P    = new SqlParameter("@SupplierID", ID);
        SqlParameter SupplierTitle_P = new SqlParameter("@SupplierTitle", SupplierTitle);
        SqlParameter SupplierCode_P  = new SqlParameter("@SupplierCode", SupplierCode);
        SqlParameter Phone_P         = new SqlParameter("@Phone", Phone);
        SqlParameter Fax_P           = new SqlParameter("@Fax", Fax);
        SqlParameter Email_P         = new SqlParameter("@Email", Email);
        SqlParameter AddressLine1_P  = new SqlParameter("@AddressLine1", AddressLine1);
        SqlParameter AddressLine2_P  = new SqlParameter("@AddressLine2", AddressLine2);
        SqlParameter NTN_P           = new SqlParameter("@NTN", NTN);
        SqlParameter GST_P           = new SqlParameter("@GST", GST);
        SqlParameter SRB_P           = new SqlParameter("@SRB", SRB);
        SqlParameter OpBal           = new SqlParameter("@OpBal", opBal);
        SqlParameter CREATEBY        = new SqlParameter("@CreateBy", UserID);

        msg = AACommon.Execute("Supplier_Insert", Conn, SupplierID_P, SupplierTitle_P, SupplierCode_P, Phone_P, Fax_P, Email_P, AddressLine1_P, AddressLine2_P, NTN_P, GST_P, SRB_P, OpBal, CREATEBY);



        /////////////////////ACCOUNTS /////////////////////////
        string opD = "0"; string opC = "0";

        if (Convert.ToDecimal(opBal) > 0)
        {
            opD = opBal; opC = "0";
        }
        else if (Convert.ToDecimal(opBal) < 0)
        {
            opD = "0"; opC = opBal;
        }

        string       L4ID              = AACommon.GetData("SELECT AccountID FROM AACCOUNTS_Integration WHERE (Description = 'Vendors')", ConACC, "AccountID");
        string       ledgerID          = AACommon.GetAlphaNumericIDTHREE("Accounts", L4ID, "L4_ID", ConACC);
        SqlParameter L4_ID             = new SqlParameter("@L4_ID", ledgerID);
        SqlParameter Desc_Level4       = new SqlParameter("@Desc_Level4", SupplierTitle);
        SqlParameter L4_IDNew          = new SqlParameter("@L4_IDNew", L4ID);
        SqlParameter Opdr              = new SqlParameter("@Opdr", opD);
        SqlParameter Opcr              = new SqlParameter("@Opcr", opC);
        SqlParameter CompanyID         = new SqlParameter("@CompanyID", "12");
        SqlParameter FiscalID          = new SqlParameter("@FiscalID", "22");
        SqlParameter BalanceValidation = new SqlParameter("@BalanceValidation", "0");

        AACommon.Execute("Insert_Accounts", ConACC, L4_ID, Desc_Level4, L4_IDNew, Opdr, Opcr, CompanyID, FiscalID, BalanceValidation);
        /////////////////////////////////////

        string     str = "update Supplier set LedgerID='" + ledgerID + "' where SupplierID='" + ID + "'";
        SqlCommand cmd = new SqlCommand(str, Conn);

        if (Conn.State == ConnectionState.Closed)
        {
            Conn.Open();
        }
        cmd.ExecuteNonQuery();
        if (Conn.State == ConnectionState.Open)
        {
            Conn.Close();
        }



        if (msg == "Record Saved Successfully")
        {
            retMessage = "true";
        }
        else
        {
            retMessage = "false";
        }

        return(retMessage);
    }
Exemplo n.º 11
0
    public static string InsertRegion(string CustomerTitle, string CustomerCode, string Phone, string Fax, string Email, string AddressLine1, string AddressLine2, string NTN, string GST, string SRB, string UserID, string InvDays, string AgDays, string opBal, string txtCellNo, string txtPhone2, string txtCNIC, string ddlBookingDay, string ddlDeliveryDay, string ddlCustomerTypeID)
    {
        string        retMessage = string.Empty;
        string        msg        = "";
        SqlConnection Conn       = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString);
        SqlConnection ConACC     = new SqlConnection(ConfigurationManager.ConnectionStrings["ConACC"].ConnectionString);

        string       ID              = AACommon.GetAlphaNumericIDSIX("Customer", "CUS-", "CustomerID", Conn);
        SqlParameter CustomerID_P    = new SqlParameter("@CustomerID", ID);
        SqlParameter CustomerTitle_P = new SqlParameter("@CustomerTitle", CustomerTitle);
        SqlParameter CustomerCode_P  = new SqlParameter("@CustomerCode", CustomerCode);
        SqlParameter Phone_P         = new SqlParameter("@Phone", Phone);
        SqlParameter Fax_P           = new SqlParameter("@Fax", Fax);
        SqlParameter Email_P         = new SqlParameter("@Email", Email);
        SqlParameter AddressLine1_P  = new SqlParameter("@AddressLine1", AddressLine1);
        SqlParameter AddressLine2_P  = new SqlParameter("@AddressLine2", AddressLine2);
        SqlParameter NTN_P           = new SqlParameter("@NTN", NTN);
        SqlParameter GST_P           = new SqlParameter("@GST", GST);
        SqlParameter SRB_P           = new SqlParameter("@SRB", SRB);

        SqlParameter InvoiceDays = new SqlParameter("@InvoiceDays", InvDays);
        SqlParameter AgingDays   = new SqlParameter("@AgingDays", AgDays);
        SqlParameter OpBal       = new SqlParameter("@OpBal", opBal);

        SqlParameter CREATEBY = new SqlParameter("@CreateBy", UserID);


        SqlParameter CellNo         = new SqlParameter("@CellNo", txtCellNo);
        SqlParameter Phone2         = new SqlParameter("@Phone2", txtPhone2);
        SqlParameter CNIC           = new SqlParameter("@CNIC", txtCNIC);
        SqlParameter BookingDay     = new SqlParameter("@BookingDay", ddlBookingDay);
        SqlParameter DeliveryDay    = new SqlParameter("@DeliveryDay", ddlDeliveryDay);
        SqlParameter CustomerTypeID = new SqlParameter("@CustomerTypeID", ddlCustomerTypeID);

        msg = AACommon.Execute("Customer_InsertV2", Conn, CustomerID_P, CustomerTitle_P, CustomerCode_P, Phone_P, Fax_P, Email_P, AddressLine1_P, AddressLine2_P, NTN_P, GST_P, SRB_P, InvoiceDays, AgingDays, OpBal, CREATEBY, CellNo, Phone2, CNIC, BookingDay, DeliveryDay, CustomerTypeID);


        //Changes by SA //

        /////////////////////ACCOUNTS /////////////////////////
        string opD = "0"; string opC = "0";

        if (Convert.ToDecimal(opBal) > 0)
        {
            opD = opBal; opC = "0";
        }
        else if (Convert.ToDecimal(opBal) < 0)
        {
            opD = "0"; opC = opBal;
        }

        string       L4ID              = AACommon.GetData("SELECT AccountID FROM AACCOUNTS_Integration WHERE (Description = 'Accounts Receivable')", ConACC, "AccountID");
        string       ledgerID          = AACommon.GetAlphaNumericIDTHREE("Accounts", L4ID, "L4_ID", ConACC);
        SqlParameter L4_ID             = new SqlParameter("@L4_ID", ledgerID);
        SqlParameter Desc_Level4       = new SqlParameter("@Desc_Level4", CustomerTitle);
        SqlParameter L4_IDNew          = new SqlParameter("@L4_IDNew", L4ID);
        SqlParameter Opdr              = new SqlParameter("@Opdr", opD);
        SqlParameter Opcr              = new SqlParameter("@Opcr", opC);
        SqlParameter CompanyID         = new SqlParameter("@CompanyID", "12");
        SqlParameter FiscalID          = new SqlParameter("@FiscalID", "22");
        SqlParameter BalanceValidation = new SqlParameter("@BalanceValidation", "0");

        AACommon.Execute("Insert_Accounts", ConACC, L4_ID, Desc_Level4, L4_IDNew, Opdr, Opcr, CompanyID, FiscalID, BalanceValidation);
        /////////////////////////////////////

        string     str = "update Customer set LedgerID='" + ledgerID + "' where CustomerID='" + ID + "'";
        SqlCommand cmd = new SqlCommand(str, Conn);

        if (Conn.State == ConnectionState.Closed)
        {
            Conn.Open();
        }
        cmd.ExecuteNonQuery();
        if (Conn.State == ConnectionState.Open)
        {
            Conn.Close();
        }

        //Changes by SA //

        if (msg == "Record Saved Successfully")
        {
            retMessage = "true";
        }
        else
        {
            retMessage = "false";
        }

        return(retMessage);
    }