protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         BindProducts();
         BindCategory();
         txtOrderDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
         HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");
         Int64 Oid = Convert.ToInt64(ocommon.Decrypt(Request.QueryString["oid"].ToString(), true));
         // Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true)
         if (Request.QueryString["oid"] != null)
         {
             ddlUserType.Enabled = false;
             ddlname.Enabled     = false;
             BindOrders(Convert.ToInt64(ocommon.Decrypt(Request.QueryString["oid"].ToString(), true)));
             btnSave.Text         = "Update";
             hPageTitle.InnerText = "Product Update";
             Page.Title           = "Product Update";
         }
         else
         {
             //hPageTitle.InnerText = "Product Add";
             //Page.Title = "Product Add";
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");

        if (!Page.IsPostBack)
        {
            BindUser();
            BindStateandCity();
            if (Request.QueryString["id"] != null)
            {
                hPageTitle.InnerText = "Update Retailer";
                Page.Title           = "Update Retailer";
                btnUpdate.Text       = "Update";
                BindDealer(ocommon.Decrypt(Convert.ToString(Request.QueryString["id"]), true));
                txtbalance.ReadOnly = true;
            }
            else
            {
                hPageTitle.InnerText = "New Retailer";
                Page.Title           = "New Retailer";
                btnUpdate.Text       = "Add";
                //BindDealer(ocommon.Decrypt(Convert.ToString(Request.QueryString["id"]), true));
            }
        }
    }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         BindMainCategoryBrand();
         BindProcessCombo();
         //BindColor();
         //BindSize();
         HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");
         if (Request.QueryString["id"] != null)
         {
             BindProducts(Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true)));
             BindArticle(Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true)));
             btnSave.Text         = "Update";
             hPageTitle.InnerText = "Update Article";
             Page.Title           = "Update Article";
         }
         else
         {
             BindArticle(0);
             hPageTitle.InnerText = "New Article";
             Page.Title           = "New Article";
         }
     }
 }
    //private void BindRepeter()
    //{
    //    string productdata = "SELECT id,'' as sr, particulars, wages  FROM   productparticulars where id = 0";
    //    SqlDataAdapter daproduct = new SqlDataAdapter(productdata, con);
    //    DataTable dtprod = new DataTable();
    //    daproduct.Fill(dtprod);
    //    repProcess.DataSource = dtprod;
    //    repProcess.DataBind();
    //    ViewState["dtprod"] = dtprod;
    //}

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");

            BindProduct();

            //BindRepeter();
            if (Request.QueryString["id"] != null)
            {
                Int64 pid = Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true));
                ddlProduct.SelectedValue = pid.ToString();
                BindArticle(pid);
                btnSave.Text         = "UPDATE";
                hPageTitle.InnerText = "Update Article";
                Page.Title           = "Update Article";
            }
            else
            {
                BindArticle(0);
                hPageTitle.InnerText = "New Article";
                Page.Title           = "New Article";
                btnSave.Text         = "ADD";
            }
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        txt_Date.Text     = String.Format(new System.Globalization.CultureInfo("en-US"), "{0:d/M/yyyy}", DateTime.Now);
        txtStockDate.Text = String.Format(new System.Globalization.CultureInfo("en-US"), "{0:d/M/yyyy}", DateTime.Now);

        //-------------------------------------------------
        if (!IsPostBack)
        {
            ddlname.Focus();

            ddlinvoiceType.SelectedValue = "Including GST";
            BindRepeater();
            Bindvendor();
            BindProducts();
            HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");
            if (Request.QueryString["oid"] != null)
            {
                BindOrders(Convert.ToInt64(ocommon.Decrypt(Request.QueryString["oid"].ToString(), true)));
                btnSave.Text         = "Update";
                hPageTitle.InnerText = "Order Update";
                Page.Title           = "Order Update";
            }
            else
            {
                hPageTitle.InnerText = "Order Add";
                Page.Title           = "Order Add";
            }
        }
    }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");

        hPageTitle.InnerText = "Add Edit Product Images";
        if (!Page.IsPostBack)
        {
            BindImagesUsingProductId(Convert.ToInt64(ocommon.Decrypt(Convert.ToString(Request.QueryString["id"]), true)));
        }
    }
Esempio n. 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");

        if (!Page.IsPostBack)
        {
            BindUser();
            if (Request.QueryString["id"] != null)
            {
                hPageTitle.InnerText = "Update Dealer";
                Page.Title           = "Update Dealer";
                btnUpdate.Text       = "Update";
                BindDealer(ocommon.Decrypt(Convert.ToString(Request.QueryString["id"]), true));
            }
        }
    }
Esempio n. 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         BindOrderDetails(Convert.ToInt64(ocommon.Decrypt(Request.QueryString["oid"].ToString(), true)));
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");
         if (Request.QueryString["id"] != null)
         {
             BindOffer(Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true)));
             btnSave.Text         = "UPDATE";
             hPageTitle.InnerText = "Update Offer ";
             Page.Title           = "Update Offer ";
         }
         else
         {
             hPageTitle.InnerText = "Add Offer";
             Page.Title           = "Add Offer";
         }
     }
 }
Esempio n. 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         //BindCategory();
         BindUnits();
         HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");
         if (Request.QueryString["id"] != null)
         {
             BindProducts(Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true)));
             btnSave.Text         = "Update";
             hPageTitle.InnerText = "Raw Material Update";
             Page.Title           = "Raw Material Update";
         }
         else
         {
             hPageTitle.InnerText = "Raw Material Add";
             Page.Title           = "Raw Material Add";
         }
     }
 }
Esempio n. 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");

        if (!Page.IsPostBack)
        {
            if (Request.QueryString["id"] != null)
            {
                hPageTitle.InnerText = "Update New Product Arrival";
                Page.Title           = "Update New Product Arrival";
                btnAddEditNews.Text  = "UPADTE";
                BindNews(ocommon.Decrypt(Convert.ToString(Request.QueryString["id"]), true));
            }
            else
            {
                hPageTitle.InnerText = "Add New Product Arrival";
                Page.Title           = "Add New Product Arrival";
                btnAddEditNews.Text  = "ADD";
            }
        }
    }
Esempio n. 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        txtpaymentDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");

        if (!Page.IsPostBack)
        {
            bindBank();
            HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");
            hPageTitle.InnerText = "Payment";
            Page.Title           = "Payment";
            BindPaymentDetails(Convert.ToInt64(ocommon.Decrypt(Request.QueryString["oid"].ToString(), true)));
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         //BindBank();
         HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");
         if (Request.QueryString["id"] != null)
         {
             BindCategory(Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true)));
             btnSave.Text         = "Update";
             hPageTitle.InnerText = "Type Update";
             Page.Title           = "Type Update";
         }
         else
         {
             hPageTitle.InnerText     = "Type Add";
             Page.Title               = "Type Add";
             btnSave.Text             = "Add";
             txtCategoryDiscount.Text = "0";
             txtActualPrice.Text      = "0";
         }
     }
 }
Esempio n. 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["userid"] == null)
     {
         Response.Redirect(Page.ResolveUrl("~/login.aspx"));
     }
     if (!Page.IsPostBack)
     {
         if (Request.QueryString["deviceid"] != null)
         {
             Bind_Contact_Person_Information(Convert.ToInt64(Ocommon.Decrypt(Request.QueryString["deviceid"].ToString(), true)));
             Bind_SMS_Alert_Data(Convert.ToInt64(Ocommon.Decrypt(Request.QueryString["deviceid"].ToString(), true)));
         }
         HtmlGenericControl hPageTitle = (HtmlGenericControl)this.Page.Master.FindControl("hPageTitle");
         hPageTitle.InnerText = "Contact Person";
     }
 }
    private void Bind()
    {
        if (Request.QueryString["id"] != null)
        {
            worksheetid = Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true));
        }
        DataTable      dtWorksheetdetails = new DataTable();
        SqlDataAdapter da;

        try
        {
            SqlCommand cmd = new SqlCommand
            {
                CommandText = "getWorksheetDetailsForArticleProduction",
                CommandType = CommandType.StoredProcedure,
                Connection  = con
            };
            cmd.Parameters.AddWithValue("@id", worksheetid);
            con.Open();

            da = new SqlDataAdapter(cmd);
            da.Fill(dtWorksheetdetails);
        }
        catch (Exception ex)
        {
            ErrHandler.writeError(ex.Message, ex.StackTrace);
        }
        finally
        {
            con.Close();
        }

        if (dtWorksheetdetails != null)
        {
            if (dtWorksheetdetails.Rows.Count > 0)
            {
                txtworksheetno.Text   = Convert.ToString(dtWorksheetdetails.Rows[0]["id"]);
                txtworksheetdate.Text = Convert.ToString(dtWorksheetdetails.Rows[0]["createddate"]);
                txtarticleno.Text     = Convert.ToString(dtWorksheetdetails.Rows[0]["productname"]);
                txtcolor.Text         = Convert.ToString(dtWorksheetdetails.Rows[0]["colornames"]);
                txtsize.Text          = Convert.ToString(dtWorksheetdetails.Rows[0]["sizenames"]);
            }
        }
    }
    private void BindInvoiceImage()
    {
        DataTable  dtImage = new DataTable();
        SqlCommand cmd     = new SqlCommand();

        cmd.CommandText = "Select top 2 adminimage from orderimagemaster where adminimage is not null and oid=" + Convert.ToInt64(ocommon.Decrypt(Request.QueryString["oid"].ToString(), true)) + " order by createddatetime desc ";
        cmd.CommandType = CommandType.Text;
        cmd.Connection  = con;
        con.Open();
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(dtImage);
        try
        {
            divImage.Visible = true;
            if (dtImage.Rows.Count > 0)
            {
                for (int i = 0; i < dtImage.Rows.Count; i++)
                {
                    if (i == 0)
                    {
                        imgOrderImage1.ImageUrl = OrderInvoiceMainPath + dtImage.Rows[i]["adminimage"].ToString();
                    }
                    if (i == 1)
                    {
                        imgOrderImage2.ImageUrl = OrderInvoiceMainPath + dtImage.Rows[i]["adminimage"].ToString();
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ErrHandler.writeError(ex.Message, ex.StackTrace);
        }
        finally
        {
            con.Close();
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Int64     Result = 0, Result1 = 0;
        DataTable dtProduct = new DataTable();


        String user = null, month = null, pono = null;
        bool   flag = false, flag1 = false, flag2 = false, flag3 = false;

        int year = int.Parse(DateTime.Now.Year.ToString());

        month = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Month);
        int day  = int.Parse(DateTime.Now.Day.ToString());
        int min  = int.Parse(DateTime.Now.Minute.ToString());
        int hour = int.Parse(DateTime.Now.Hour.ToString());

        pono = year + "_" + month.Substring(0, 3).ToUpper() + "_" + day + "_" + hour + min;

        SqlConnection       con         = new SqlConnection(ConfigurationManager.ConnectionStrings["cnstring"].ConnectionString);
        PurchaseOrderHeader objcategory = new PurchaseOrderHeader();

        objcategory.PONo     = pono;
        objcategory.VendorId = Int64.Parse(ddlVendor.SelectedValue);

        objcategory.isdeleted = false;

        if (Request.QueryString["id"] != null)
        {
            objcategory.PurchaseOrderId = Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true));
            Result = (new Cls_PurchaseOrderHeader_b().Update(objcategory));
            if (Result > 0)
            {
                Response.Redirect(Page.ResolveUrl("~/managepurchaseorder.aspx?mode=u"));
            }
            else
            {
            }
        }
        else
        {
            Result = (new Cls_PurchaseOrderHeader_b().Insert(objcategory));
            if (Result > 0)
            {
                con.Open();
                if (ViewState["Products"] != null)
                {
                    dtProduct = (DataTable)ViewState["Products"];
                }
                PurchaseOrderDetails objPod = new PurchaseOrderDetails();
                foreach (DataRow row in dtProduct.Rows)
                {
                    /*
                     * string s = "INSERT INTO [DoctorDiagnosisNew].[PurchaseOrderDetails]([PurchaseOrderId],[ProdId],[BrandId],[SizeId],[Quantity],[isdeleted],[Quantity1]) VALUES("
                     + Result + "," + row["ProdId"] + "," + row["BrandId"] + "," + row["SizeId"] + "," + row["Quantity"] + "," + 0 + "," + row["Quantity"] + ")";
                     + SqlCommand cmd = new SqlCommand(s, con);
                     * */
                    objPod.PurchaseOrderId = Result;
                    objPod.ProdId          = Convert.ToInt64(row["ProdId"]);
                    objPod.CategoryId      = Convert.ToInt64(row["CatId"]);
                    objPod.Quantity        = Convert.ToInt64(row["Quantity"]);
                    objPod.Quantity1       = Convert.ToInt64(row["Quantity"]);

                    Result1 = (new Cls_PurchaseOrderDetails_b().Insert(objPod));

                    //if (Result1 > 0)
                    // flag = true;
                }

                con.Close();

                //Clear();

                String vendorname = ddlVendor.SelectedItem.ToString();
                String mailTo     = txtEmail.Text.Trim();
                //String Name = txt_contactperson.Text.Trim();
                String MobileNo = txtMobile.Text.Trim();
                flag  = PDFUpload(Result);
                flag1 = SendOrderMail(mailTo, pono);
                //flag2 = SendSMS(vendorname, MobileNo);

                if (flag)
                {
                    Response.Redirect(Page.ResolveUrl("~/managepurchaseorder.aspx?mode=i"));
                }
            }
            else
            {
            }
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Int64     Result = 0, Result1 = 0;
        DataTable dtProduct = new DataTable();

        //Response.Write(hf1.Value);

        String valuesColor = hfcolorid.Value, valuesSize = hfsizeid.Value;


        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cnstring"].ConnectionString);
        //id,productid,sizeid,colorid,createdby,createddate,isdeleted
        worksheetmaster objworksheetmaster = new worksheetmaster();

        objworksheetmaster.Productid = Convert.ToInt64(ddlArticle.SelectedValue.ToString());
        //objworksheetmaster.Sizeid = Convert.ToInt64(ddlSize.SelectedValue.ToString());
        //objworksheetmaster.Colorid = Convert.ToInt64(ddlColor.SelectedValue.ToString());
        objworksheetmaster.Colorid     = valuesColor;
        objworksheetmaster.Sizeid      = valuesSize;
        objworksheetmaster.Createdby   = Convert.ToInt64(createdby);
        objworksheetmaster.Createddate = Convert.ToDateTime(txtWorkDate.Text.ToString());

        //PurchaseOrderHeader objcategory = new PurchaseOrderHeader();
        //objcategory.PONo = pono;
        //objcategory.VendorId = Int64.Parse(ddlVendor.SelectedValue);

        //objcategory.isdeleted = false;

        if (Request.QueryString["id"] != null)
        {
            objworksheetmaster.Id = Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true));
            Result = (new Cls_worksheetmaster_b().Update(objworksheetmaster));
            if (Result > 0)
            {
                Response.Redirect(Page.ResolveUrl("~/manageworksheets.aspx?mode=u"));
            }
            else
            {
            }
        }
        else
        {
            Result = (new Cls_worksheetmaster_b().Insert(objworksheetmaster));
            if (Result > 0)
            {
                con.Open();
                if (ViewState["Products"] != null)
                {
                    dtProduct = (DataTable)ViewState["Products"];
                }
                worksheetdetails objPod = new worksheetdetails();
                foreach (DataRow row in dtProduct.Rows)
                {
                    //id,worksheetid,particularsid,employeeid,workdate,quantity,remark

                    objPod.Worksheetid   = Result;
                    objPod.Particularsid = Convert.ToInt64(row["operationid"]);
                    objPod.Employeeid    = Convert.ToInt64(row["employeeid"]);
                    objPod.Quantity      = Convert.ToInt64(row["quantity"]);
                    objPod.Wages         = Convert.ToDouble(row["wages"]);
                    objPod.Workdate      = Convert.ToDateTime(row["date"]);
                    objPod.Remark        = Convert.ToString(row["remark"]);

                    Result1 = (new Cls_worksheetdetails_b().Insert(objPod));

                    //if (Result1 > 0)
                    // flag = true;
                }

                con.Close();
                Response.Redirect(Page.ResolveUrl("~/manageworksheets.aspx?mode=i"));
            }
            else
            {
            }
        }
    }
    private void Bind()
    {
        DataSet        dtWorksheetdetails = new DataSet();
        DataTable      dtEmployee         = new DataTable();
        SqlDataAdapter da;

        if (Request.QueryString["id"] != null)
        {
            worksheetid = Convert.ToInt64(ocommon.Decrypt(Request.QueryString["id"].ToString(), true));
        }
        try
        {
            SqlCommand cmd = new SqlCommand
            {
                CommandText = "getWorksheetDetailsForArticleProduction",
                CommandType = CommandType.StoredProcedure,
                Connection  = con
            };
            cmd.Parameters.AddWithValue("@id", worksheetid);
            con.Open();

            da = new SqlDataAdapter(cmd);
            da.Fill(dtWorksheetdetails);


            SqlCommand cmdemp = new SqlCommand
            {
                CommandText = "SELECT employeename,id FROM tblEmployeeMaster WHERE id IN (SELECT empid FROM employeewages WHERE isdeleted=0) AND isdelete=0",
                CommandType = CommandType.Text,
                Connection  = con
            };
            cmdemp.Parameters.AddWithValue("@id", worksheetid);
            //con.Open();

            da = new SqlDataAdapter(cmdemp);
            da.Fill(dtEmployee);


            if (dtEmployee != null)
            {
                if (dtEmployee.Rows.Count > 0)
                {
                    lstemployee.DataSource     = dtEmployee;
                    lstemployee.DataTextField  = "employeename";
                    lstemployee.DataValueField = "id";
                    lstemployee.DataBind();
                    //System.Web.UI.WebControls.ListItem objListItem = new System.Web.UI.WebControls.ListItem("--Select Color--", "0");
                    //lstemployee.Items.Insert(0, objListItem);
                }
                else
                {
                    lstemployee.DataSource     = dtEmployee;
                    lstemployee.DataTextField  = "employeename";
                    lstemployee.DataValueField = "id";
                    lstemployee.DataBind();
                }
            }
            else
            {
                lstemployee.DataSource     = dtEmployee;
                lstemployee.DataTextField  = "employeename";
                lstemployee.DataValueField = "id";
                lstemployee.DataBind();
            }
        }
        catch (Exception ex)
        {
            ErrHandler.writeError(ex.Message, ex.StackTrace);
        }
        finally
        {
            con.Close();
        }

        if (dtWorksheetdetails != null)
        {
            if (dtWorksheetdetails.Tables[0].Rows.Count > 0)
            {
                if (dtWorksheetdetails.Tables[0].Rows.Count > 0)
                {
                    txtworksheetno.Text   = Convert.ToString(dtWorksheetdetails.Tables[0].Rows[0]["id"]);
                    txtworksheetdate.Text = Convert.ToString(dtWorksheetdetails.Tables[0].Rows[0]["createddate"]);
                    txtarticleno.Text     = Convert.ToString(dtWorksheetdetails.Tables[0].Rows[0]["productname"]);
                    txtcolor.Text         = Convert.ToString(dtWorksheetdetails.Tables[0].Rows[0]["colornames"]);
                    txtsize.Text          = Convert.ToString(dtWorksheetdetails.Tables[0].Rows[0]["groupname"]);
                    txtpid.Text           = Convert.ToString(dtWorksheetdetails.Tables[0].Rows[0]["productid"]);
                    txtcolorid.Text       = Convert.ToString(dtWorksheetdetails.Tables[0].Rows[0]["colorid"]);
                    txtsizegroupid.Text   = Convert.ToString(dtWorksheetdetails.Tables[0].Rows[0]["sizeid"]);
                }
            }

            if (dtWorksheetdetails.Tables[1].Rows.Count > 0)
            {
                if (dtWorksheetdetails.Tables[1].Rows.Count > 0)
                {
                    Repeater1.DataSource = dtWorksheetdetails.Tables[1];
                    Repeater1.DataBind();
                }
            }
        }
    }