public Int64 Insert(PurchaseOrderHeader objorders)
        {
            Int64 result = 0;

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "PurchaseOrderHeader_Insert";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;

                SqlParameter param = new SqlParameter();
                param.ParameterName = "@oid";
                param.Value         = objorders.oid;
                param.SqlDbType     = SqlDbType.BigInt;
                param.Direction     = ParameterDirection.InputOutput;
                cmd.Parameters.Add(param);
                cmd.Parameters.AddWithValue("@uid", objorders.uid);

                cmd.Parameters.AddWithValue("@invoicetype", objorders.invoicetype);
                cmd.Parameters.AddWithValue("@invoiceno", objorders.invoiceno);
                cmd.Parameters.AddWithValue("@orderdate", objorders.orderdate);
                cmd.Parameters.AddWithValue("@accountYear", objorders.accountYear);
                cmd.Parameters.AddWithValue("@subtotal", objorders.subtotal);
                cmd.Parameters.AddWithValue("@discandScheme", objorders.discandScheme);
                cmd.Parameters.AddWithValue("@frieghtamount", objorders.frieghtamount);
                cmd.Parameters.AddWithValue("@taxableamount", objorders.taxableamount);
                cmd.Parameters.AddWithValue("@CGSTamt", objorders.CGSTamt);
                cmd.Parameters.AddWithValue("@SGSTamt", objorders.SGSTamt);
                cmd.Parameters.AddWithValue("@IGSTamt", objorders.IGSTamt);
                cmd.Parameters.AddWithValue("@totalAmt", objorders.totalAmt);
                cmd.Parameters.AddWithValue("@transportamt", objorders.transportamt);
                cmd.Parameters.AddWithValue("@packingamt", objorders.packingamt);
                cmd.Parameters.AddWithValue("@otheramt", objorders.otheramt);
                cmd.Parameters.AddWithValue("@grandtotal", objorders.grandtotal);
                cmd.Parameters.AddWithValue("@pendingAmt", objorders.pendingAmt);
                cmd.Parameters.AddWithValue("@stockdate", objorders.stockdate);

                ConnectionString.Open();
                cmd.ExecuteNonQuery();
                result = Convert.ToInt64(param.Value);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(result);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(result);
        }
        public orderproducts SelectById(Int64 opid)
        {
            SqlDataAdapter da;
            DataSet        ds = new DataSet();
            orderproducts  objorderproducts = new orderproducts();

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "orderproducts_SelectById";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;
                cmd.Parameters.AddWithValue("@opid", opid);
                ConnectionString.Open();
                da = new SqlDataAdapter(cmd);
                da.Fill(ds);

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0] != null)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                {
                                    objorderproducts.opid         = Convert.ToInt64(ds.Tables[0].Rows[0]["opid"]);
                                    objorderproducts.oid          = Convert.ToInt64(ds.Tables[0].Rows[0]["oid"]);
                                    objorderproducts.uid          = Convert.ToInt64(ds.Tables[0].Rows[0]["uid"]);
                                    objorderproducts.pid          = Convert.ToInt64(ds.Tables[0].Rows[0]["pid"]);
                                    objorderproducts.productprice = Convert.ToDecimal(ds.Tables[0].Rows[0]["productprice"]);
                                    objorderproducts.gst          = Convert.ToDecimal(ds.Tables[0].Rows[0]["gst"]);
                                    objorderproducts.discount     = Convert.ToInt32(ds.Tables[0].Rows[0]["discount"]);
                                    objorderproducts.productafterdiscountprice = Convert.ToDecimal(ds.Tables[0].Rows[0]["productafterdiscountprice"]);
                                    objorderproducts.quantites         = Convert.ToInt32(ds.Tables[0].Rows[0]["quantites"]);
                                    objorderproducts.producttotalprice = Convert.ToDecimal(ds.Tables[0].Rows[0]["producttotalprice"]);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(null);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(objorderproducts);
        }
Ejemplo n.º 3
0
        public Int64 Update(PurchaseOrderDetails objorderproducts)
        {
            Int64 result = 0;

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "PurchaseOrderDetails_Update";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;

                SqlParameter param = new SqlParameter();
                param.ParameterName = "@opid";
                param.Value         = objorderproducts.opid;
                param.SqlDbType     = SqlDbType.BigInt;
                param.Direction     = ParameterDirection.InputOutput;
                cmd.Parameters.Add(param);
                //cmd.Parameters.AddWithValue("@oid", objorderproducts.oid);
                cmd.Parameters.AddWithValue("@oid", objorderproducts.oid);
                cmd.Parameters.AddWithValue("@uid", objorderproducts.uid);
                cmd.Parameters.AddWithValue("@pid", objorderproducts.pid);
                cmd.Parameters.AddWithValue("@qty", objorderproducts.qty);
                cmd.Parameters.AddWithValue("@rate", objorderproducts.rate);


                cmd.Parameters.AddWithValue("@subtotal", objorderproducts.subtotal);
                cmd.Parameters.AddWithValue("@discount", objorderproducts.discount);
                cmd.Parameters.AddWithValue("@scheme", objorderproducts.scheme);

                cmd.Parameters.AddWithValue("@frieghtamt", objorderproducts.frieghtamt);
                cmd.Parameters.AddWithValue("@taxableamt", objorderproducts.taxableamt);
                cmd.Parameters.AddWithValue("@csgtper", objorderproducts.csgtper);
                cmd.Parameters.AddWithValue("@sgstper", objorderproducts.sgstper);
                cmd.Parameters.AddWithValue("@igstper", objorderproducts.igstper);
                cmd.Parameters.AddWithValue("@netrate", objorderproducts.netrate);
                cmd.Parameters.AddWithValue("@gstamt", objorderproducts.gstamt);
                cmd.Parameters.AddWithValue("@total", objorderproducts.total);
                ConnectionString.Open();
                cmd.ExecuteNonQuery();
                result = Convert.ToInt64(param.Value);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(result);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(result);
        }
Ejemplo n.º 4
0
        public Int64 Update(customerRegistration objcustomerRegistration)
        {
            Int64 result = 0;

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "customer_Update";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;


                SqlParameter param = new SqlParameter();
                param.ParameterName = "@id";
                param.Value         = objcustomerRegistration.id;
                param.SqlDbType     = SqlDbType.BigInt;
                param.Direction     = ParameterDirection.InputOutput;
                cmd.Parameters.Add(param);
                cmd.Parameters.AddWithValue("@customerName", objcustomerRegistration.customerName);
                cmd.Parameters.AddWithValue("@email", objcustomerRegistration.email);
                cmd.Parameters.AddWithValue("@phoneNo", objcustomerRegistration.phoneNo);
                cmd.Parameters.AddWithValue("@address", objcustomerRegistration.address);
                cmd.Parameters.AddWithValue("@password", objcustomerRegistration.password);
                //cmd.Parameters.AddWithValue("@latitude", objcustomerRegistration.latitude);
                //cmd.Parameters.AddWithValue("@lognitude", objcustomerRegistration.lognitude);
                cmd.Parameters.AddWithValue("@img", objcustomerRegistration.img);
                cmd.Parameters.AddWithValue("@annivarsaryDate", Convert.ToDateTime(objcustomerRegistration.annivarsaryDate));
                cmd.Parameters.AddWithValue("@birthdate", Convert.ToDateTime(objcustomerRegistration.birthdate));
                cmd.Parameters.AddWithValue("@business", objcustomerRegistration.business);
                cmd.Parameters.AddWithValue("@job", objcustomerRegistration.job);
                cmd.Parameters.AddWithValue("@reference", objcustomerRegistration.reference);
                cmd.Parameters.AddWithValue("@days", objcustomerRegistration.days);
                cmd.Parameters.AddWithValue("@deliveryShift", objcustomerRegistration.deliveryShift);
                cmd.Parameters.AddWithValue("@deliveryTime", objcustomerRegistration.deliveryTime);
                cmd.Parameters.AddWithValue("@doorStep", objcustomerRegistration.doorStep);


                ConnectionString.Open();
                cmd.ExecuteNonQuery();
                result = Convert.ToInt64(param.Value);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(result);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(result);
        }
Ejemplo n.º 5
0
        public category SelectById(Int64 cid)
        {
            SqlDataAdapter da;
            DataSet        ds          = new DataSet();
            category       objcategory = new category();

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "category_SelectById";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;
                cmd.Parameters.AddWithValue("@cid", cid);
                ConnectionString.Open();
                da = new SqlDataAdapter(cmd);
                da.Fill(ds);

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0] != null)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                {
                                    objcategory.cid           = Convert.ToInt64(ds.Tables[0].Rows[0]["cid"]);
                                    objcategory.categoryname  = Convert.ToString(ds.Tables[0].Rows[0]["categoryname"]);
                                    objcategory.imagename     = Convert.ToString(ds.Tables[0].Rows[0]["imagename"]);
                                    objcategory.actualprice   = Convert.ToDecimal(ds.Tables[0].Rows[0]["actualprice"]);
                                    objcategory.discountprice = Convert.ToDecimal(ds.Tables[0].Rows[0]["discountprice"]);
                                    objcategory.shortdesc     = Convert.ToString(ds.Tables[0].Rows[0]["shortdesc"]);
                                    objcategory.longdescp     = Convert.ToString(ds.Tables[0].Rows[0]["longdescp"]);
                                    //objcategory.bankid = Convert.ToInt32(ds.Tables[0].Rows[0]["bankid"]);
                                    objcategory.maincategoryid = Convert.ToInt32(ds.Tables[0].Rows[0]["maincategoryid"]);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(null);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(objcategory);
        }
Ejemplo n.º 6
0
    public void search()
    {
        #region
        SqlConnection  ConnectionString = new SqlConnection(ConfigurationManager.ConnectionStrings["cnstring"].ConnectionString);
        DataTable      ds = new DataTable();
        SqlDataAdapter da;
        try
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "dealer_SelectAllAdminPagingNew";

            cmd.CommandType = CommandType.StoredProcedure;
            if (txtSearch.Text == "")
            {
                cmd.Parameters.AddWithValue("@seachtext", null);
            }
            else
            {
                cmd.Parameters.AddWithValue("@seachtext", txtSearch.Text);
            }
            cmd.Parameters.AddWithValue("@isactive", Convert.ToInt64(ddlUserstatus.SelectedValue.ToString()));
            cmd.Parameters.AddWithValue("@isonline", Convert.ToInt64(ddlOnlineStatus.SelectedValue.ToString()));
            cmd.Connection = ConnectionString;
            ConnectionString.Open();
            da = new SqlDataAdapter(cmd);
            da.Fill(ds);
            if (ds != null)
            {
                if (ds.Rows.Count > 0)
                {
                    Session["dtProduct"] = ds;
                }
            }

            lbPrevious.Enabled = true;
            lbNext.Enabled     = false;
            lbFirst.Enabled    = true;
            lbLast.Enabled     = false;
            //CurrentPage = 0;
        }
        catch (Exception ex)
        {
            ErrHandler.writeError(ex.Message, ex.StackTrace);
        }
        finally
        {
            ConnectionString.Close();
        }
        BindDataIntoRepeater(ds);
        #endregion
    }
Ejemplo n.º 7
0
        public Int64 Insert(dealermaster objdealermaster)
        {
            Int64 result = 0;

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "dealermaster_Insert";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;

                SqlParameter param = new SqlParameter();
                param.ParameterName = "@did";
                param.Value         = objdealermaster.did;
                param.SqlDbType     = SqlDbType.BigInt;
                param.Direction     = ParameterDirection.InputOutput;
                cmd.Parameters.Add(param);

                cmd.Parameters.AddWithValue("@name", objdealermaster.name);
                cmd.Parameters.AddWithValue("@userloginmobileno", objdealermaster.userloginmobileno);
                cmd.Parameters.AddWithValue("@password", objdealermaster.password);
                cmd.Parameters.AddWithValue("@whatappno", objdealermaster.whatappno);
                cmd.Parameters.AddWithValue("@email", objdealermaster.email);
                cmd.Parameters.AddWithValue("@gstno", objdealermaster.gstno);
                cmd.Parameters.AddWithValue("@aadharno", objdealermaster.gstno);
                cmd.Parameters.AddWithValue("@panno", objdealermaster.gstno);
                cmd.Parameters.AddWithValue("@address1", objdealermaster.address1);
                cmd.Parameters.AddWithValue("@address2", objdealermaster.address2);
                cmd.Parameters.AddWithValue("@city", objdealermaster.city);
                cmd.Parameters.AddWithValue("@state", objdealermaster.state);
                cmd.Parameters.AddWithValue("@guid", objdealermaster.guid);
                cmd.Parameters.AddWithValue("@district", objdealermaster.district);
                cmd.Parameters.AddWithValue("@balance", objdealermaster.balance);



                ConnectionString.Open();
                cmd.ExecuteNonQuery();
                result = Convert.ToInt64(param.Value);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(result);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(result);
        }
Ejemplo n.º 8
0
    private void GetIncomeExpenseJSON()
    {
        DataTable      dtDetails           = new DataTable();
        SqlDataAdapter daIncomeExpenseJSON = new SqlDataAdapter();
        SqlCommand     cmd = new SqlCommand();

        if (!String.IsNullOrEmpty(txt_fromDate.Text.ToString()) && !String.IsNullOrEmpty(txt_toDate.Text.ToString()))
        {
            DateTime ff = DateTime.ParseExact(txt_fromDate.Text, "dd/MM/yyyy", null);
            System.Data.SqlTypes.SqlDateTime dtSql = System.Data.SqlTypes.SqlDateTime.Parse(ff.ToString("yyyy-MM-dd"));
            from = dtSql.ToString();
            from = txt_fromDate.Text.ToString();
            to   = txt_toDate.Text.ToString();

            //from = String.Format("yyyy-MM-dd", txt_fromDate.Text.ToString());
            //to = String.Format("yyyy-MM-dd", txt_toDate.Text.ToString());
        }
        //else {
        //    //from = DateTime.ParseExact("01/01/1900", "dd/MM/yyyy", null);
        //    //to = DateTime.Now;
        //    from = "1900-01-01";
        //    to = DateTime.Now.ToString("yyyy-MM-dd");
        //}
        try
        {
            cmd.Connection = con;
            con.Open();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "getIncomeExpenseDetails";
            cmd.Parameters.AddWithValue("@from", from);
            cmd.Parameters.AddWithValue("@to", to);
            daIncomeExpenseJSON = new SqlDataAdapter(cmd);
            daIncomeExpenseJSON.Fill(dtDetails);
            if (dtDetails != null)
            {
                if (dtDetails.Rows.Count > 0)
                {
                    markers = DataTableToJSONWithJavaScriptSerializerDetails(dtDetails);
                }
            }
        }
        catch (Exception ex)
        {
            ErrHandler.writeError(ex.Message, ex.StackTrace);
        }
        finally
        {
            con.Close();
        }
    }
        public AgentMaster  SelectById(Int64 bankid)
        {
            SqlDataAdapter da;
            DataSet        ds             = new DataSet();
            AgentMaster    objAgentMaster = new AgentMaster();

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "agentmaster_SelectById";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;
                cmd.Parameters.AddWithValue("@aid", bankid);
                ConnectionString.Open();
                da = new SqlDataAdapter(cmd);
                da.Fill(ds);

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0] != null)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                {
                                    objAgentMaster.aid         = Convert.ToInt32(ds.Tables[0].Rows[0]["aid"]);
                                    objAgentMaster.Agentname   = Convert.ToString(ds.Tables[0].Rows[0]["Agentname"]);
                                    objAgentMaster.Address     = Convert.ToString(ds.Tables[0].Rows[0]["Address"]);
                                    objAgentMaster.MobileNo    = Convert.ToString(ds.Tables[0].Rows[0]["MobileNo"]);
                                    objAgentMaster.email       = Convert.ToString(ds.Tables[0].Rows[0]["email"]);
                                    objAgentMaster.createddate = Convert.ToDateTime(ds.Tables[0].Rows[0]["createddate"]);
                                    objAgentMaster.img         = Convert.ToString(ds.Tables[0].Rows[0]["img"]);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(null);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(objAgentMaster);
        }
        public bankmaster SelectById(Int64 bankid)
        {
            SqlDataAdapter da;
            DataSet        ds            = new DataSet();
            bankmaster     objbankmaster = new bankmaster();

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "bankmaster_SelectById";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;
                cmd.Parameters.AddWithValue("@bankid", bankid);
                ConnectionString.Open();
                da = new SqlDataAdapter(cmd);
                da.Fill(ds);

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0] != null)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                {
                                    objbankmaster.bankid            = Convert.ToInt32(ds.Tables[0].Rows[0]["bankid"]);
                                    objbankmaster.bankname          = Convert.ToString(ds.Tables[0].Rows[0]["bankname"]);
                                    objbankmaster.bankifsccode      = Convert.ToString(ds.Tables[0].Rows[0]["bankifsccode"]);
                                    objbankmaster.bankbranch        = Convert.ToString(ds.Tables[0].Rows[0]["bankbranch"]);
                                    objbankmaster.accountno         = Convert.ToString(ds.Tables[0].Rows[0]["accountno"]);
                                    objbankmaster.accountholdername = Convert.ToString(ds.Tables[0].Rows[0]["accountholdername"]);
                                    objbankmaster.balance           = Convert.ToDecimal(ds.Tables[0].Rows[0]["balance"]);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(null);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(objbankmaster);
        }
Ejemplo n.º 11
0
        public collectiontrip SelectById(Int64 bankid)
        {
            SqlDataAdapter da;
            DataSet        ds = new DataSet();
            collectiontrip objcollectiontrip = new collectiontrip();

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "collectiontrip_SelectById";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;
                cmd.Parameters.AddWithValue("@id", bankid);
                ConnectionString.Open();
                da = new SqlDataAdapter(cmd);
                da.Fill(ds);

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0] != null)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                {
                                    // id, weekday, cityname, empid, empname, isdeleted

                                    objcollectiontrip.id       = Convert.ToInt64(ds.Tables[0].Rows[0]["id"]);
                                    objcollectiontrip.empid    = Convert.ToInt64(ds.Tables[0].Rows[0]["empid"]);
                                    objcollectiontrip.weekday  = Convert.ToString(ds.Tables[0].Rows[0]["weekday"]);
                                    objcollectiontrip.cityname = Convert.ToString(ds.Tables[0].Rows[0]["cityname"]);
                                    objcollectiontrip.empname  = Convert.ToString(ds.Tables[0].Rows[0]["empname"]);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(null);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(objcollectiontrip);
        }
Ejemplo n.º 12
0
        public Int64 Insert(farmermaster objfarmermaster)
        {
            Int64 result = 0;

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "farmermaster_Insert";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;

                SqlParameter param = new SqlParameter();
                param.ParameterName = "@id";
                param.Value         = objfarmermaster.id;
                param.SqlDbType     = SqlDbType.BigInt;
                param.Direction     = ParameterDirection.InputOutput;
                cmd.Parameters.Add(param);


                cmd.Parameters.AddWithValue("name", objfarmermaster.name);
                cmd.Parameters.AddWithValue("img", objfarmermaster.img);
                cmd.Parameters.AddWithValue("faddress", objfarmermaster.address);
                cmd.Parameters.AddWithValue("mobileno", objfarmermaster.mobileno);
                //cmd.Parameters.AddWithValue("mobile2",objfarmermaster.mobile2);
                cmd.Parameters.AddWithValue("fpassword", objfarmermaster.password);
                cmd.Parameters.AddWithValue("emailid", objfarmermaster.email);
                cmd.Parameters.AddWithValue("bankname", objfarmermaster.bankname);
                cmd.Parameters.AddWithValue("accountno", objfarmermaster.accountno);
                cmd.Parameters.AddWithValue("ifsc", objfarmermaster.ifsc);
                cmd.Parameters.AddWithValue("milkrate", objfarmermaster.milkrate);
                cmd.Parameters.AddWithValue("countryid", objfarmermaster.countryid);
                cmd.Parameters.AddWithValue("stateid", objfarmermaster.stateid);
                cmd.Parameters.AddWithValue("cityid", objfarmermaster.cityid);


                ConnectionString.Open();
                cmd.ExecuteNonQuery();
                result = Convert.ToInt64(param.Value);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(result);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(result);
        }
        public productimagesvideos SelectById(Int64 piid)
        {
            SqlDataAdapter      da;
            DataSet             ds = new DataSet();
            productimagesvideos objproductimagesvideos = new productimagesvideos();

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "productimagesvideos_SelectById";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;
                cmd.Parameters.AddWithValue("@piid", piid);
                ConnectionString.Open();
                da = new SqlDataAdapter(cmd);
                da.Fill(ds);

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0] != null)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                {
                                    objproductimagesvideos.piid           = Convert.ToInt64(ds.Tables[0].Rows[0]["piid"]);
                                    objproductimagesvideos.pid            = Convert.ToInt64(ds.Tables[0].Rows[0]["pid"]);
                                    objproductimagesvideos.type           = Convert.ToInt32(ds.Tables[0].Rows[0]["type"]);
                                    objproductimagesvideos.imagevideoname = Convert.ToString(ds.Tables[0].Rows[0]["imagevideoname"]);
                                    objproductimagesvideos.imagevideopath = Convert.ToString(ds.Tables[0].Rows[0]["imagevideopath"]);
                                    objproductimagesvideos.isdelete       = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["isdelete"].ToString()) ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["isdelete"]);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(null);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(objproductimagesvideos);
        }
Ejemplo n.º 14
0
        public Int64 Insert(VendorMaster objVendorMaster)
        {
            Int64 result = 0;

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "vendorMaster_Insert";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;



                SqlParameter param = new SqlParameter();
                param.ParameterName = "@vid";
                param.Value         = objVendorMaster.vid;
                param.SqlDbType     = SqlDbType.Int;
                param.Direction     = ParameterDirection.InputOutput;
                cmd.Parameters.Add(param);
                cmd.Parameters.AddWithValue("@vendorName", objVendorMaster.vendorName);
                cmd.Parameters.AddWithValue("@Address1", objVendorMaster.Address1);
                cmd.Parameters.AddWithValue("@Address2", objVendorMaster.Address2);
                cmd.Parameters.AddWithValue("@MobileNo1", objVendorMaster.MobileNo1);
                cmd.Parameters.AddWithValue("@MobileNo2", objVendorMaster.MobileNo2);
                cmd.Parameters.AddWithValue("@email", objVendorMaster.email);
                cmd.Parameters.AddWithValue("@landline", objVendorMaster.landline);

                cmd.Parameters.AddWithValue("@fk_agentId", objVendorMaster.fk_agentId);
                cmd.Parameters.AddWithValue("@fk_countryId", objVendorMaster.fk_countryId);
                cmd.Parameters.AddWithValue("@fk_stateId", objVendorMaster.fk_stateId);
                cmd.Parameters.AddWithValue("@fk_cityId", objVendorMaster.fk_cityId);
                cmd.Parameters.AddWithValue("@img", objVendorMaster.img);


                ConnectionString.Open();
                cmd.ExecuteNonQuery();
                result = Convert.ToInt64(param.Value);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(result);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(result);
        }
        public offers SelectById(Int64 offerid)
        {
            SqlDataAdapter da;
            DataSet        ds        = new DataSet();
            offers         objoffers = new offers();

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "offers_SelectById";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;
                cmd.Parameters.AddWithValue("@offerid", offerid);
                ConnectionString.Open();
                da = new SqlDataAdapter(cmd);
                da.Fill(ds);

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0] != null)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                {
                                    objoffers.offerid   = Convert.ToInt64(ds.Tables[0].Rows[0]["offerid"]);
                                    objoffers.title     = Convert.ToString(ds.Tables[0].Rows[0]["title"]);
                                    objoffers.descp     = Convert.ToString(ds.Tables[0].Rows[0]["descp"]);
                                    objoffers.imagename = Convert.ToString(ds.Tables[0].Rows[0]["imagename"]);
                                    objoffers.validfrom = Convert.ToString(ds.Tables[0].Rows[0]["validfrom"]);
                                    objoffers.validto   = Convert.ToString(ds.Tables[0].Rows[0]["validto"]);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(null);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(objoffers);
        }
    public void BindOrderReport()
    {
        SqlConnection  ConnectionString = new SqlConnection(ConfigurationManager.ConnectionStrings["cnstring"].ToString());
        DataTable      dtOrderReport    = new DataTable();
        SqlDataAdapter da;

        try
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "sp_OrderReport";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Year", ddlYear.SelectedValue.ToString());
            cmd.Parameters.AddWithValue("@Month", ddlMonth.SelectedValue.ToString());
            cmd.Connection = ConnectionString;
            ConnectionString.Open();
            da = new SqlDataAdapter(cmd);
            da.Fill(dtOrderReport);
            if (dtOrderReport != null)
            {
                if (dtOrderReport.Rows.Count > 0)
                {
                    spnMessage.Visible       = false;
                    gvOrderReport.DataSource = dtOrderReport;
                    gvOrderReport.DataBind();
                    Session["dtProduct"] = dtOrderReport;
                }
                else
                {
                    spnMessage.Visible       = true;
                    gvOrderReport.DataSource = null;
                    gvOrderReport.DataBind();
                }
            }
            else
            {
                spnMessage.Visible       = true;
                gvOrderReport.DataSource = null;
                gvOrderReport.DataBind();
            }
        }
        catch (Exception ex)
        {
            ErrHandler.writeError(ex.Message, ex.StackTrace);
        }
        finally
        {
            ConnectionString.Close();
        }
    }
Ejemplo n.º 17
0
    public void search()
    {
        #region
        SqlConnection  ConnectionString = new SqlConnection(ConfigurationManager.ConnectionStrings["cnstring"].ConnectionString);
        DataTable      ds = new DataTable();
        SqlDataAdapter da;
        try
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "Order_SelectAll";

            cmd.CommandType = CommandType.StoredProcedure;

            Int64 idd = Convert.ToInt64(ddlPaymentType.SelectedValue.ToString());

            cmd.Parameters.Add("@paymentStatus", idd);
            //if (txtSearch.Text == "")
            //{
            //    cmd.Parameters.Add("@seachtext", null);
            //}
            //else
            //{
            //    cmd.Parameters.Add("@seachtext", txtSearch.Text);

            //}

            cmd.Connection = ConnectionString;
            ConnectionString.Open();
            da = new SqlDataAdapter(cmd);
            da.Fill(ds);


            lbPrevious.Enabled = true;
            lbNext.Enabled     = false;
            lbFirst.Enabled    = true;
            lbLast.Enabled     = false;
            //CurrentPage = 0;
        }
        catch (Exception ex)
        {
            ErrHandler.writeError(ex.Message, ex.StackTrace);
        }
        finally
        {
            ConnectionString.Close();
        }
        BindDataIntoRepeater(ds);
        #endregion
    }
        public feedback SelectById(Int64 feedbackid)
        {
            SqlDataAdapter da;
            DataSet        ds          = new DataSet();
            feedback       objfeedback = new feedback();

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "feedback_SelectById";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = ConnectionString;
                cmd.Parameters.AddWithValue("@feedbackid", feedbackid);
                ConnectionString.Open();
                da = new SqlDataAdapter(cmd);
                da.Fill(ds);

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0] != null)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                {
                                    objfeedback.feedbackid      = Convert.ToInt64(ds.Tables[0].Rows[0]["feedbackid"]);
                                    objfeedback.name            = Convert.ToString(ds.Tables[0].Rows[0]["name"]);
                                    objfeedback.phone           = Convert.ToString(ds.Tables[0].Rows[0]["phone"]);
                                    objfeedback.feedbackmessage = Convert.ToString(ds.Tables[0].Rows[0]["feedbackmessage"]);
                                    objfeedback.feedbackdt      = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["feedbackdt"].ToString()) ? DateTime.MinValue : Convert.ToDateTime(ds.Tables[0].Rows[0]["feedbackdt"]);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(null);
            }
            finally
            {
                ConnectionString.Close();
            }
            return(objfeedback);
        }
Ejemplo n.º 19
0
    public void BindImagesUsingProductId(Int64 ProductId)
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cnstring"].ConnectionString);

        try
        {
            DataTable dtGallery = new DataTable();
            con.Open();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "SELECT * FROM productimagesvideos Where isdelete=0 and pid=" + ProductId;
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con;
            SqlDataAdapter sda = new SqlDataAdapter();
            cmd.Connection    = con;
            sda.SelectCommand = cmd;
            sda.Fill(dtGallery);
            con.Close();
            if (dtGallery != null)
            {
                if (dtGallery.Rows.Count > 0)
                {
                    repImage.Visible    = true;
                    repImage.DataSource = dtGallery;
                    repImage.DataBind();
                }
                else
                {
                    repImage.Visible    = false;
                    repImage.DataSource = null;
                    repImage.DataBind();
                }
            }
            else
            {
                repImage.Visible    = false;
                repImage.DataSource = null;
                repImage.DataBind();
            }
        }
        catch (Exception ex)
        {
            ErrHandler.writeError(ex.Message, ex.StackTrace);
        }
        finally
        {
            con.Close();
        }
    }
Ejemplo n.º 20
0
        public Int64 Update(unitMaster objcategory)
        {
            Int64 result = 0;

            try
            {
                Cls_unit_db objCls_unit_db = new Cls_unit_db();
                result = Convert.ToInt64(objCls_unit_db.Update(objcategory));
                return(result);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(result);
            }
        }
Ejemplo n.º 21
0
        public unitMaster SelectById(Int64 cid)
        {
            unitMaster objcategory = new unitMaster();

            try
            {
                Cls_unit_db objCls_unit_db = new Cls_unit_db();
                objcategory = objCls_unit_db.SelectById(cid);
                return(objcategory);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(objcategory);
            }
        }
Ejemplo n.º 22
0
        public DataTable SelectAll()
        {
            DataTable dt = new DataTable();

            try
            {
                Cls_unit_db objCls_unit_db = new Cls_unit_db();
                dt = objCls_unit_db.SelectAll();
                return(dt);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(dt);
            }
        }
Ejemplo n.º 23
0
        public DataTable Selectorderdetailsbydealerid(Int64 dealerId)
        {
            DataTable dt = new DataTable();

            try
            {
                Cls_orders_db objCls_orders_db = new Cls_orders_db();
                dt = objCls_orders_db.Selectorderdetailsbydealerid(dealerId);
                return(dt);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(dt);
            }
        }
        public farmerproducts SelectById(Int64 cid)
        {
            farmerproducts objfarmerproducts = new farmerproducts();

            try
            {
                Cls_farmerproducts_db objCls_farmerproducts_db = new Cls_farmerproducts_db();
                objfarmerproducts = objCls_farmerproducts_db.SelectById(cid);
                return(objfarmerproducts);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(objfarmerproducts);
            }
        }
        public Int64 Update(farmerproducts objfarmerproducts)
        {
            Int64 result = 0;

            try
            {
                Cls_farmerproducts_db objCls_farmerproducts_db = new Cls_farmerproducts_db();
                result = Convert.ToInt64(objCls_farmerproducts_db.Update(objfarmerproducts));
                return(result);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(result);
            }
        }
Ejemplo n.º 26
0
        public Int64 Insert(ProcessMaster objcategory)
        {
            Int64 result = 0;

            try
            {
                Cls_process_db objCls_process_db = new Cls_process_db();
                result = Convert.ToInt64(objCls_process_db.Insert(objcategory));
                return(result);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(result);
            }
        }
        public Int64 Insert(offers objoffers)
        {
            Int64 result = 0;

            try
            {
                Cls_offers_db objCls_offers_db = new Cls_offers_db();
                result = Convert.ToInt64(objCls_offers_db.Insert(objoffers));
                return(result);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(result);
            }
        }
        public offers SelectById(Int64 offerid)
        {
            offers objoffers = new offers();

            try
            {
                Cls_offers_db objCls_offers_db = new Cls_offers_db();
                objoffers = objCls_offers_db.SelectById(offerid);
                return(objoffers);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(objoffers);
            }
        }
        public DataSet SelectAll()
        {
            DataSet dt = new DataSet();

            try
            {
                Cls_porders_db objCls_porders_db = new Cls_porders_db();
                dt = objCls_porders_db.SelectAll();
                return(dt);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(dt);
            }
        }
Ejemplo n.º 30
0
        public DataTable category_WSSelectById(Int64 cid)
        {
            DataTable dt = new DataTable();

            try
            {
                Cls_category_db objCls_category_db = new Cls_category_db();
                dt = objCls_category_db.category_WSSelectById(cid);
                return(dt);
            }
            catch (Exception ex)
            {
                ErrHandler.writeError(ex.Message, ex.StackTrace);
                return(dt);
            }
        }