Beispiel #1
0
        protected void btnProductMasterUploadImg_OnClick(object sender, EventArgs e)
        {
            if (FileUploadProductMasterImg.PostedFiles != null)
            {
                CustomProfile        profile       = CustomProfile.GetProfile();
                iProductMasterClient productClient = new iProductMasterClient();

                string uploadfilepath = HttpRuntime.AppDomainAppPath;

                foreach (PostedFileInfo info in FileUploadProductMasterImg.PostedFiles)
                {
                    string type = info.ContentType.Replace("image/", "").Replace("application/", "");
                    //type = type.Replace("application/", "");
                    string gridDisplayPath = "TempImg\\" + Session.SessionID.ToString() + DateTime.Now.Ticks.ToString() + "." + type;
                    string SaveAsPath      = uploadfilepath + "\\" + gridDisplayPath;
                    //SaveAsPath = SaveAsPath.Replace('\\', '/');

                    if (!(Directory.Exists(uploadfilepath + "/TempImg")))
                    {
                        Directory.CreateDirectory(uploadfilepath + "/TempImg");
                    }
                    info.SaveAs(SaveAsPath);

                    tImage UploadedImage = new tImage();
                    UploadedImage.ObjectName  = "Product";
                    UploadedImage.ReferenceID = Convert.ToInt32(hdnprodID.Value);
                    UploadedImage.ImageName   = info.FileName;
                    UploadedImage.ImgeTitle   = txtImageTitle.Text;
                    UploadedImage.ImageDesc   = txtImageDescription.Text;
                    UploadedImage.Path        = gridDisplayPath;
                    UploadedImage.Extension   = type;
                    //UploadedImage.Active = "Y";
                    if (rbtnYes.Checked == true)
                    {
                        UploadedImage.Active = "Y";
                    }
                    else
                    {
                        UploadedImage.Active = "N";
                    }
                    UploadedImage.CreatedBy    = profile.Personal.UserID.ToString();
                    UploadedImage.CreationDate = DateTime.Now;
                    UploadedImage.CompanyID    = profile.Personal.CompanyID;
                    productClient.AddTempProductImages(UploadedImage, Session.SessionID, profile.Personal.UserID.ToString(), profile.DBConnection._constr);
                }

                GVImages.DataSource = productClient.GetTempSaveProductImagesBySessionID(Session.SessionID, profile.Personal.UserID.ToString(), profile.DBConnection._constr);
                GVImages.DataBind();
                txtImageDescription.Text = "";
                txtImageTitle.Text       = "";
            }
        }
Beispiel #2
0
        protected void GetProductImagesByProductID()
        {
            CustomProfile profile = CustomProfile.GetProfile();

            if (hdnprodID.Value == "")
            {
                hdnprodID.Value = "0";
            }
            iProductMasterClient productClient = new iProductMasterClient();

            GVImages.DataSource = productClient.GetProductImagesByProductID(Convert.ToInt64(hdnprodID.Value), Session.SessionID.ToString(), profile.Personal.UserID.ToString(), profile.DBConnection._constr);
            GVImages.DataBind();
            productClient.Close();
        }
Beispiel #3
0
        protected void clear()
        {
            CustomProfile profile = CustomProfile.GetProfile();

            // ddlProductType.SelectedIndex = -1;
            //ddlCategory.SelectedIndex = -1;
            // ddlSubCategory.SelectedIndex = -1;
            txtProductCode.Text = "";
            txtProductName.Text = "";
            // ddlUOM.SelectedIndex = -1;
            //txtPrincipalPrice.Text = "";
            //txtFixedDisc.Text = "";
            //chkboxFixedDiscIsPercent.Checked = false;
            //chkProductSpe.Items[0].Selected = false;
            //chkProductSpe.Items[1].Selected = false;
            //txtWarrenyInDays.Text = "0";
            //txtGuaranteeInDays.Text = "0";
            //txtOpeningBalance.Text = "";
            //txtCurrentBalance.Text = "";
            //txtReorderLevel.Text = "";
            //txtMaxBalanceQuantity.Text = "";
            //txtMinOrderQuantity.Text = "";
            //txtLeadTimeInDays.Text = "";
            hdnprodID.Value = null;

            GVImages.DataSource = null;
            GVImages.DataBind();

            GVProductSpecification.DataSource = null;
            GVProductSpecification.DataBind();

            GVTaxSetup.DataSource = null;
            GVTaxSetup.DataBind();

            iProductMasterClient productClient = new iProductMasterClient();

            productClient.ClearTempSaveProductSpecificationDetailBySessionID(Session.SessionID.ToString(), profile.Personal.UserID.ToString(), profile.DBConnection._constr);

            productClient.ClearTempSaveProductTaxDetailBySessionID(Session.SessionID.ToString(), profile.Personal.UserID.ToString(), profile.DBConnection._constr);

            productClient.ClearTempSaveProductImagesBySessionID(Session.SessionID.ToString(), profile.Personal.UserID.ToString(), profile.DBConnection._constr);

            productClient.Close();
            ResetUserControl();
        }