Beispiel #1
0
        // SAVE CALENDAR SETTINGS

        public bool Save_Calendar_Settings(BEL be)
        {
            bool status = false;

            da.Save_Calendar_Settings(be);
            return(status);
        }
Beispiel #2
0
        // SAVE CATEGORY MASTER

        public bool Save_Product_Master(BEL be)
        {
            bool status = false;

            cmd             = new SqlCommand("Save_Product_Master", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Product_Code", be.Product_Code);
            cmd.Parameters.AddWithValue("@Product_Category", be.Product_Category);
            cmd.Parameters.AddWithValue("@Product_Name", be.Product_Name);
            cmd.Parameters.AddWithValue("@Purchase_Price", be.Purchase_Price);
            cmd.Parameters.AddWithValue("@Market_Price", be.Market_Price);
            cmd.Parameters.AddWithValue("@Sales_Price", be.Sales_Price);
            cmd.Parameters.AddWithValue("@Unit_Name", be.Unit_Name);
            cmd.Parameters.AddWithValue("@CGST_PER", be.CGST_PER);
            cmd.Parameters.AddWithValue("@SGST_PER", be.SGST_PER);
            cmd.Parameters.AddWithValue("@IGST_PER", be.IGST_PER);

            con.Open();
            int res = cmd.ExecuteNonQuery();

            con.Close();
            if (res > 0)
            {
                status = true;
            }
            return(status);
        }
Beispiel #3
0
        // FETCH ACCOUNT NO FOR DELETE TRANSACTION

        public DataSet Fetch_Account_No_Delete_Transaction(BEL be)
        {
            cmd             = new SqlCommand("Select Isnull(Account_No,0) as Account_No from Daily_Transaction where Transaction_Id='" + be.Transaction_Id + "' and Transaction_Date='" + be.Transaction_Date + "' and Flag='AC' group by Account_No", con);
            cmd.CommandType = CommandType.Text;
            try
            {
                con.Open();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        be.Account_No = (reader["Account_No"].ToString());
                    }
                }
            }
            finally
            {
                con.Close();
            }
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            return(ds);
        }
Beispiel #4
0
        // SAVE SALES INVOICE

        public bool Save_Sales_Invoice(BEL be)
        {
            bool status = false;

            da.Save_Sales_Invoice(be);
            return(status);
        }
Beispiel #5
0
        // FETCH SALES CLOSING BALANCE

        public DataSet Fetch_Sales_Closing_Balance(BEL be)
        {
            cmd             = new SqlCommand("Select Closing_Balance from Sales_Invoice where Account_No ='" + be.Account_No + "'", con);
            cmd.CommandType = CommandType.Text;
            try
            {
                con.Open();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        be.Closing_Balance = (reader["Closing_Balance"].ToString());
                    }
                }
            }
            finally
            {
                con.Close();
            }
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            return(ds);
        }
Beispiel #6
0
        // SAVE PURCHASE INVOICE

        public bool Save_Purchase_Invoice(BEL be)
        {
            bool status = false;

            da.Save_Purchase_Invoice(be);
            return(status);
        }
Beispiel #7
0
        // GET CUSTOMER ID

        public DataSet Get_Customer_Id(BEL be)
        {
            cmd             = new SqlCommand("Get_Customer_Id", con);
            cmd.CommandType = CommandType.StoredProcedure;
            try
            {
                con.Open();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        be.Product_Code = (reader["Customer_Id"].ToString());
                    }
                }
            }
            finally
            {
                con.Close();
            }
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            return(ds);
        }
Beispiel #8
0
        // FETCH CALENDAR DATE

        public DataSet Fetch_Calendar_Date(BEL be)
        {
            cmd             = new SqlCommand("Fetch_Calendar_Settings", con);
            cmd.CommandType = CommandType.StoredProcedure;
            try
            {
                con.Open();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        be.Calendar_Date = (reader["Calendar_Dates"].ToString());
                    }
                }
            }
            finally
            {
                con.Close();
            }
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            return(ds);
        }
Beispiel #9
0
        // SAVE UNIT MASTER

        public bool Save_Unit_Master(BEL be)
        {
            bool status = false;

            da.Save_Unit_Master(be);
            return(status);
        }
Beispiel #10
0
        // SAVE CATEGORY MASTER

        public bool Save_Category_Master(BEL be)
        {
            bool status = false;

            da.Save_Category_Master(be);
            return(status);
        }
Beispiel #11
0
        // SAVE PRODUCT MASTER

        public bool Save_Supplier_Master(BEL be)
        {
            bool status = false;

            da.Save_Supplier_Master(be);
            return(status);
        }
Beispiel #12
0
        // FETCH COMPANY MASTER

        public DataSet Fetch_Company_Master(BEL be)
        {
            cmd             = new SqlCommand("Fetch_Company_Master", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Branch_Code", be.Branch_Code);
            try
            {
                con.Open();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        be.Company_Name   = (reader["Company_Name"].ToString());
                        be.Address_Line_1 = (reader["Address_Line_1"].ToString());
                        be.Address_Line_2 = (reader["Address_Line_2"].ToString());
                        be.Town_City      = (reader["Com_City_Town"].ToString());
                        be.District       = (reader["Com_District"].ToString());
                        be.State          = (reader["Com_State"].ToString());
                        be.Pincode        = (reader["Com_Pincode"].ToString());
                        be.Contact_No_1   = (reader["Com_Phone"].ToString());
                        be.Gst_No         = (reader["Com_Gst_No"].ToString());
                    }
                }
            }
            finally
            {
                con.Close();
            }
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            return(ds);
        }
Beispiel #13
0
        // SAVE PURCHASE INVOICE

        public bool Save_Purchase_Invoice(BEL be)
        {
            bool status = false;

            cmd             = new SqlCommand("Save_Purchase_Invoice", con);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@Invoice_No", be.Invoice_No);
            cmd.Parameters.AddWithValue("@Invoice_Date", DateTime.ParseExact(be.Invoice_Date, "dd/MM/yyyy", null));
            cmd.Parameters.AddWithValue("@Supplier_Id", be.Supplier_Id);
            cmd.Parameters.AddWithValue("@Supplier_Name", be.Supplier_Name);
            cmd.Parameters.AddWithValue("@Scheme_Code", be.Scheme_Code);
            cmd.Parameters.AddWithValue("@Purchase_Value", be.Purchase_Value);
            cmd.Parameters.AddWithValue("@Addition", be.Addition);
            cmd.Parameters.AddWithValue("@Deduction", be.Deduction);
            cmd.Parameters.AddWithValue("@Grand_Total", be.Grand_Total);
            cmd.Parameters.AddWithValue("@Closing_Balance", be.Closing_Balance);
            cmd.Parameters.AddWithValue("@Transaction_Id", be.Transaction_Id);
            cmd.Parameters.AddWithValue("@Transaction_Date", DateTime.ParseExact(be.Transaction_Date, "dd/MM/yyyy", null));
            cmd.Parameters.AddWithValue("@Receipt_No", be.Receipt_No);

            con.Open();
            int res = cmd.ExecuteNonQuery();

            con.Close();
            if (res > 0)
            {
                status = true;
            }
            return(status);
        }
Beispiel #14
0
        // PURCHASE MASTER

        // GET PURCHASE INVOICE NO

        public DataSet Get_Purchase_Invoice_No(BEL be)
        {
            cmd             = new SqlCommand("Get_Purchase_Invoice_No", con);
            cmd.CommandType = CommandType.StoredProcedure;
            try
            {
                con.Open();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        be.Invoice_No = (reader["Invoice_No"].ToString());
                    }
                }
            }
            finally
            {
                con.Close();
            }
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            return(ds);
        }
Beispiel #15
0
        // SAVE CUSTOMER MASTER

        public bool Save_Customer_Master(BEL be)
        {
            bool status = false;

            da.Save_Customer_Master(be);
            return(status);
        }
Beispiel #16
0
        // SAVE CUSTOMER MASTER

        public bool Save_Customer_Master(BEL be)
        {
            bool status = false;

            cmd             = new SqlCommand("Save_Customer_Master", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Customer_Id", be.Customer_Id);
            cmd.Parameters.AddWithValue("@Customer_Name", be.Customer_Name);
            cmd.Parameters.AddWithValue("@Address_Line_1", be.Address_Line_1);
            cmd.Parameters.AddWithValue("@Address_Line_2", be.Address_Line_2);
            cmd.Parameters.AddWithValue("@Town_City", be.Town_City);
            cmd.Parameters.AddWithValue("@District", be.District);
            cmd.Parameters.AddWithValue("@State", be.State);
            cmd.Parameters.AddWithValue("@Pincode", be.Pincode);
            cmd.Parameters.AddWithValue("@Contact_Person", be.Contact_Person);
            cmd.Parameters.AddWithValue("@Contact_No_1", be.Contact_No_1);
            cmd.Parameters.AddWithValue("@Contact_No_2", be.Contact_No_2);
            cmd.Parameters.AddWithValue("@Email", be.Email);
            cmd.Parameters.AddWithValue("@Gst_No", be.Gst_No);
            cmd.Parameters.AddWithValue("@Remarks", be.Remarks);
            con.Open();
            int res = cmd.ExecuteNonQuery();

            con.Close();
            if (res > 0)
            {
                status = true;
            }
            return(status);
        }
Beispiel #17
0
        // FETCH PURCHASE DETAILS

        public DataTable Fetch_Purchase_Details(BEL be)
        {
            cmd             = new SqlCommand("Fetch_Purchase_Details", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Invoice_No", be.Invoice_No);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable      dt = new DataTable();

            da.Fill(dt);
            return(dt);
        }
Beispiel #18
0
        // PURCHASE LIST

        // BIND PURCHASE LIST

        public DataTable Bind_Purchase_Master(BEL be)
        {
            cmd             = new SqlCommand("Bind_Purchase_Master", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Search", be.Search);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable      dt = new DataTable();

            da.Fill(dt);
            return(dt);
        }
Beispiel #19
0
        // FETCH ACCOUNT TRANSACTIONS

        public DataTable Fetch_Account_Transactions(BEL be)
        {
            cmd             = new SqlCommand("Fetch_Account_Transactions", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Account_No", be.@Account_No);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable      dt = new DataTable();

            da.Fill(dt);
            return(dt);
        }
Beispiel #20
0
        // BIND SALES BALANCE

        public DataTable Bind_Sales_Balance(BEL be)
        {
            cmd             = new SqlCommand("Bind_Sales_Balance", con);
            cmd.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            cmd.Parameters.AddWithValue("@Account_No", be.Search);
            DataTable dt = new DataTable();

            da.Fill(dt);
            return(dt);
        }
Beispiel #21
0
        // VIEW TRANSACTIONS

        public DataTable View_Transactions(BEL be)
        {
            cmd             = new SqlCommand("View_Transactions", con);
            cmd.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            cmd.Parameters.AddWithValue("@From_Date", DateTime.ParseExact(be.From_Date, "dd/MM/yyyy", null));
            cmd.Parameters.AddWithValue("@To_Date", DateTime.ParseExact(be.To_Date, "dd/MM/yyyy", null));
            DataTable dt = new DataTable();

            da.Fill(dt);
            return(dt);
        }
Beispiel #22
0
        // FETCH GL MASTER TRAN

        public DataTable Fetch_GL_Master_Tran(BEL be)
        {
            cmd             = new SqlCommand("Fetch_GL_Master_Tran", con);
            cmd.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            cmd.Parameters.AddWithValue("@Account_No", be.Account_No);
            cmd.Parameters.AddWithValue("@From_Date", DateTime.ParseExact(be.From_Date, "dd/MM/yyyy", null));
            cmd.Parameters.AddWithValue("@To_Date", DateTime.ParseExact(be.To_Date, "dd/MM/yyyy", null));
            DataTable dt = new DataTable();

            da.Fill(dt);
            return(dt);
        }
Beispiel #23
0
        // SAVE CALENDAR SETTINGS

        public bool Save_Calendar_Settings(BEL be)
        {
            bool status = false;

            cmd             = new SqlCommand("Save_Calendar_Settings", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Calendar_Date", DateTime.ParseExact(be.Calendar_Date, "dd/MM/yyyy", null));
            con.Open();
            int res = cmd.ExecuteNonQuery();

            con.Close();
            if (res > 0)
            {
                status = true;
            }
            return(status);
        }
Beispiel #24
0
        // BIND PRODUCT DETAILS

        public DataSet Fetch_Product_Details(BEL be)
        {
            cmd             = new SqlCommand("Fetch_Product_Details", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Search", be.Product_Code);
            try
            {
                con.Open();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            be.Product_Code = (reader["Product_Code"].ToString());
                            be.Product_Name = (reader["Product_Name"].ToString());
                            be.Unit_Name    = (reader["Unit_Name"].ToString());
                            be.Sales_Price  = (reader["Sales_Price"].ToString());
                            be.CGST_PER     = (reader["CGST_PER"].ToString());
                            be.SGST_PER     = (reader["SGST_PER"].ToString());
                            be.IGST_PER     = (reader["IGST_PER"].ToString());
                        }
                    }
                    else
                    {
                        be.Product_Code = "";
                        be.Product_Name = "";
                        be.Unit_Name    = "";
                        be.CGST_PER     = "";
                        be.SGST_PER     = "";
                        be.IGST_PER     = "";
                    }
                }
            }
            finally
            {
                con.Close();
            }
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            return(ds);
        }
Beispiel #25
0
        // SAVE UNIT MASTER

        public bool Save_Unit_Master(BEL be)
        {
            bool status = false;

            cmd             = new SqlCommand("Save_Unit_Master", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Id", be.Id);
            cmd.Parameters.AddWithValue("@Unit_Name", be.Unit_Name);
            con.Open();
            int res = cmd.ExecuteNonQuery();

            con.Close();
            if (res > 0)
            {
                status = true;
            }
            return(status);
        }
Beispiel #26
0
        // FETCH CUSTOMER DETAILS

        public DataSet Fetch_Customer_Details(BEL be)
        {
            cmd             = new SqlCommand("Fetch_Customer_Details", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Customer_Id", be.Customer_Id);
            try
            {
                con.Open();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        be.Customer_Id    = (reader["Customer_Id"].ToString());
                        be.Customer_Name  = (reader["Customer_Name"].ToString());
                        be.Address_Line_1 = (reader["Address_Line_1"].ToString());
                        be.Address_Line_2 = (reader["Address_Line_2"].ToString());
                        be.Town_City      = (reader["Town_City"].ToString());
                        be.District       = (reader["District"].ToString());
                        be.State          = (reader["State"].ToString());
                        be.Pincode        = (reader["Pincode"].ToString());
                        be.Contact_Person = (reader["Contact_Person"].ToString());
                        be.Contact_No_1   = (reader["Contact_No_1"].ToString());
                        be.Contact_No_2   = (reader["Contact_No_2"].ToString());
                        be.Email          = (reader["Email"].ToString());
                        be.Gst_No         = (reader["Gst_No"].ToString());
                        be.Remarks        = (reader["Remarks"].ToString());
                    }
                }
            }
            finally
            {
                con.Close();
            }
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            return(ds);
        }
Beispiel #27
0
        // FETCH PURCHASE MASTER

        public DataSet Fetch_Purchase_Master(BEL be)
        {
            cmd             = new SqlCommand("Fetch_Purchase_Master", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Invoice_No", be.Invoice_No);
            try
            {
                con.Open();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        be.Invoice_No       = (reader["Invoice_No"].ToString());
                        be.Invoice_Date     = (reader["Invoice_Date"].ToString());
                        be.Supplier_Id      = (reader["Supplier_Id"].ToString());
                        be.Supplier_Name    = (reader["Supplier_Name"].ToString());
                        be.Scheme_Code      = (reader["Scheme_Code"].ToString());
                        be.Purchase_Value   = (reader["Purchase_Value"].ToString());
                        be.Addition         = (reader["Addition"].ToString());
                        be.Deduction        = (reader["Deduction"].ToString());
                        be.Grand_Total      = (reader["Grand_Total"].ToString());
                        be.Closing_Balance  = (reader["Closing_Balance"].ToString());
                        be.Transaction_Id   = (reader["Transaction_Id"].ToString());
                        be.Transaction_Date = (reader["Transaction_Date"].ToString());
                        be.Receipt_No       = (reader["Receipt_No"].ToString());
                    }
                }
            }
            finally
            {
                con.Close();
            }
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            return(ds);
        }
Beispiel #28
0
        // FETCH COMPANY MASTER

        public DataSet Fetch_Company_Master(BEL be)
        {
            return(da.Fetch_Company_Master(be));
        }
Beispiel #29
0
        // FETCH GL MASTER TRAN

        public DataTable Fetch_GL_Master_Tran(BEL be)
        {
            return(da.Fetch_GL_Master_Tran(be));
        }
Beispiel #30
0
        // FETCH ACCOUNT NO FOR DELETE TRANSACTION

        public DataSet Fetch_Account_No_Delete_Transaction(BEL be)
        {
            return(da.Fetch_Account_No_Delete_Transaction(be));
        }