public void SearchInvoiceItems()
        {
            this.dsInvoiceItems = InvoiceItem.GetInvoiceItems(this.cnConnection, this.iiSearch);

            this.dgvInvoiceItems.DataSource = this.dsInvoiceItems;
            this.dgvInvoiceItems.DataMember = "tabInvoiceItems";

            for (int i = 0; i < this.dsInvoiceItems.Tables["tabInvoiceItems"].Rows.Count; i++)
            {
                if ((int)this.dsInvoiceItems.Tables["tabInvoiceItems"].Rows[i]["intRequestNumber"] == -1)
                {
                    this.dgvInvoiceItems.Rows[i].Cells["intRequestNumberAsName"].Value = "بدون درخواست";
                }
                else
                {
                    this.dgvInvoiceItems.Rows[i].Cells["intRequestNumberAsName"].Value =
                        this.dsInvoiceItems.Tables["tabInvoiceItems"].Rows[i]["intRequestNumber"];
                }

                this.dgvInvoiceItems.Rows[i].Cells["nvcStoreCodeAsName"].Value =
                    StoreCode.GetMaterialTypeFromStoreCode(this.cnConnection, this.dsInvoiceItems.Tables["tabInvoiceItems"].Rows[i]["nvcStoreCode"].ToString());

                this.dobTotalCost += (double)this.dsInvoiceItems.Tables["tabInvoiceItems"].Rows[i]["floAmount"] *
                                     (double)this.dsInvoiceItems.Tables["tabInvoiceItems"].Rows[i]["floPrice"];

                this.dgvInvoiceItems.Rows[i].Cells["floTotalCost"].Value =
                    (double)this.dsInvoiceItems.Tables["tabInvoiceItems"].Rows[i]["floAmount"] *
                    (double)this.dsInvoiceItems.Tables["tabInvoiceItems"].Rows[i]["floPrice"];
            }

            this.labTotalCost.Text = String.Format("{0:n0}", this.dobTotalCost);
        }
Example #2
0
        /// <summary>
        /// 获取所有仓库
        /// </summary>
        /// <param name="tum"></param>
        /// <returns></returns>
        public List <StoreCode> QueryStore(t_ADMM_UsrMst tum)
        {
            try
            {
                var list = (from u in db.t_ADMM_UsrItem
                            join g in db.t_ADMM_UsrDataRightMst on u.fGrpCode equals g.fUsrID
                            join k in db.t_ADMM_UsrDataRightItem on g.fUsrID equals k.fUsrID
                            where u.fUsrID == tum.fUsrID & k.fItemCode == "13"
                            select new
                {
                    fValue = k.fValue,
                    fValueDesc = k.fValueDesc
                }).ToList().Distinct();

                List <StoreCode> data = new List <StoreCode>();
                foreach (var item in list)
                {
                    StoreCode n = new StoreCode();
                    n.fValue     = item.fValue;
                    n.fValueDesc = item.fValueDesc;
                    data.Add(n);
                }
                return(data);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #3
0
        private void Materials_Load(object sender, EventArgs e)
        {
            this.dsTypes = StoreCode.GetTypesAsDataSet(this.cnConnection, this.tySearch);

            this.dgvTypes.DataSource = this.dsTypes;
            this.dgvTypes.DataMember = "tabStuffTypes";
        }
        private void Materials_Load(object sender, EventArgs e)
        {
            this.dsMaterials = StoreCode.GetMaterialsAsDataSet(this.cnConnection, this.maSearch);

            this.dgvMaterials.DataSource = this.dsMaterials;
            this.dgvMaterials.DataMember = "tabStuffMaterials";
        }
Example #5
0
 private void DgvStoreGetOutItems_Sorted(object sender, EventArgs e)
 {
     for (int i = 0; i < this.dtStoreGetOutItems.Rows.Count; i++)
     {
         this.dgvStoreGetOutItems.Rows[i].Cells["nvcStuffStoreCodeAsName"].Value =
             StoreCode.GetNameByStoreCode(this.cnConnection, this.dgvStoreGetOutItems.Rows[i].Cells["nvcStuffStoreCode"].Value.ToString());
     }
 }
Example #6
0
        private void StoreGetOutItemUpdate_Load(object sender, EventArgs e)
        {
            this.cbActionType.DataSource = Enum.GetValues(typeof(ActionType));

            this.tbAmount.Text              = this.sgoiUpdate.dobStuffAmount.ToString();
            this.tbStoreGetOutNumber.Text   = this.sgoiUpdate.intStoreGetOutNumber.ToString();
            this.labStuff.Text              = StoreCode.GetNameByStoreCode(this.cnConnection, this.sgoiUpdate.strStuffStoreCode);
            this.cbActionType.SelectedIndex = --this.sgoiUpdate.intTechnicalActionType;

            SetEnableBtmOk();
        }
        public void FillSections()
        {
            this.cbCategories.Items.Clear();
            this.seSections = StoreCode.GetSections(this.cnConnection, this.stStores[this.cbStores.SelectedIndex].strCode);
            foreach (StoreCode.Section seSections in this.seSections)
            {
                this.cbCategories.Items.Add(seSections.strName);
            }

            this.cbName.Items.Clear();
            this.cbBranch.Items.Clear();
            this.labCode.Text = "";
            this.labName.Text = "";
        }
Example #8
0
        public void SearchRequestItems()
        {
            this.dtStoreGetOutItems = StoreGetOutItem.GetStoreGetOutItemsBySGONumber(this.cnConnection, this.sgoStoreGetOut.intNumber);

            this.dgvStoreGetOutItems.DataSource = this.dtStoreGetOutItems;

            for (int i = 0; i < this.dtStoreGetOutItems.Rows.Count; i++)
            {
                this.dgvStoreGetOutItems.Rows[i].Cells["nvcStuffStoreCodeAsName"].Value =
                    StoreCode.GetNameByStoreCode(this.cnConnection, this.dgvStoreGetOutItems.Rows[i].Cells["nvcStuffStoreCode"].Value.ToString());
                this.dgvStoreGetOutItems.Rows[i].Cells["intTechnicalActionTypeAsName"].Value =
                    (ActionType)this.dgvStoreGetOutItems.Rows[i].Cells["intTechnicalActionType"].Value;
            }
        }
        public void FillTypes()
        {
            this.cbBranch.Items.Clear();
            this.tyTypes = StoreCode.GetTypes(this.cnConnection,
                                              this.stStores[this.cbStores.SelectedIndex].strCode,
                                              this.seSections[this.cbCategories.SelectedIndex].strCode,
                                              this.maMaterials[this.cbName.SelectedIndex].strCode);
            foreach (StoreCode.Type coCode in this.tyTypes)
            {
                this.cbBranch.Items.Add(coCode.strName);
            }

            this.labCode.Text = "";
            this.labName.Text = "";
        }
        public void FillMaterials()
        {
            this.cbName.Items.Clear();
            this.maMaterials = StoreCode.GetMaterials(this.cnConnection,
                                                      this.stStores[this.cbStores.SelectedIndex].strCode,
                                                      this.seSections[this.cbCategories.SelectedIndex].strCode);
            foreach (StoreCode.Material miMinorGroup in this.maMaterials)
            {
                this.cbName.Items.Add(miMinorGroup.strName);
            }

            this.cbBranch.Items.Clear();
            this.labCode.Text = "";
            this.labName.Text = "";
        }
        public void FillStores()
        {
            this.cbStores.Items.Clear();
            this.stStores = StoreCode.GetStores(this.cnConnection);
            foreach (StoreCode.Store stStore in this.stStores)
            {
                this.cbStores.Items.Add(stStore.strName);
            }

            this.cbCategories.Items.Clear();
            this.cbName.Items.Clear();
            this.cbBranch.Items.Clear();
            this.labCode.Text = "";
            this.labName.Text = "";
        }
Example #12
0
        private void BtmOK_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.dsTypes.Tables["tabStuffTypes"].Rows.Count; i++)
            {
                if (this.dsTypes.Tables["tabStuffTypes"].Rows[i].RowState == DataRowState.Deleted)
                {
                    StoreCode.TypeDelete(this.cnConnection, (int)this.dsTypes.Tables["tabStuffTypes"].Rows[i]["intID", DataRowVersion.Original]);
                }

                if (this.dsTypes.Tables["tabStuffTypes"].Rows[i].RowState == DataRowState.Added)
                {
                    StoreCode.Type tyType = new StoreCode.Type();
                    tyType.strStore    = this.tySearch.strStore;
                    tyType.strSection  = this.tySearch.strSection;
                    tyType.strMaterial = this.tySearch.strMaterial;
                    tyType.strName     = this.dsTypes.Tables["tabStuffTypes"].Rows[i]["nvcName"].ToString();

                    StoreCode.TypeInsert(this.cnConnection, tyType);
                }

                if (this.dsTypes.Tables["tabStuffTypes"].Rows[i].RowState == DataRowState.Modified)
                {
                    StoreCode.Type tyType = new StoreCode.Type();
                    tyType.intID   = (int)this.dsTypes.Tables["tabStuffTypes"].Rows[i]["intID"];
                    tyType.strName = this.dsTypes.Tables["tabStuffTypes"].Rows[i]["nvcName"].ToString();
                    StoreCode.TypeUpdate(this.cnConnection, tyType);
                }
            }

            //if (this.Owner is StuffUpdate)
            //{
            //    StuffUpdate frmStuffUpdate = (StuffUpdate)this.Owner;
            //    frmStuffUpdate.FillTypes();
            //}
            //if (this.Owner is StuffInsert)
            //{
            //    StuffInsert frmStuffInsert = (StuffInsert)this.Owner;
            //    frmStuffInsert.FillTypes();
            //}

            this.Close();
        }
        private void BtmOK_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.dsMaterials.Tables["tabStuffMaterials"].Rows.Count; i++)
            {
                if (this.dsMaterials.Tables["tabStuffMaterials"].Rows[i].RowState == DataRowState.Deleted)
                {
                    StoreCode.MaterialDelete(this.cnConnection, (int)this.dsMaterials.Tables["tabStuffMaterials"].Rows[i]["intID", DataRowVersion.Original]);
                }

                if (this.dsMaterials.Tables["tabStuffMaterials"].Rows[i].RowState == DataRowState.Added)
                {
                    StoreCode.Material maMaterial = new StoreCode.Material();

                    maMaterial.strStore   = this.maSearch.strStore;
                    maMaterial.strSection = this.maSearch.strSection;
                    maMaterial.strName    = this.dsMaterials.Tables["tabStuffMaterials"].Rows[i]["nvcName"].ToString();

                    StoreCode.MaterialInsert(this.cnConnection, maMaterial);
                }

                if (this.dsMaterials.Tables["tabStuffMaterials"].Rows[i].RowState == DataRowState.Modified)
                {
                    StoreCode.Material maMaterial = new StoreCode.Material();
                    maMaterial.intID   = (int)this.dsMaterials.Tables["tabStuffMaterials"].Rows[i]["intID"];
                    maMaterial.strName = this.dsMaterials.Tables["tabStuffMaterials"].Rows[i]["nvcName"].ToString();
                    StoreCode.MaterialUpdate(this.cnConnection, maMaterial);
                }
            }

            //if (this.Owner is StuffUpdate)
            //{
            //    StuffUpdate frmStuffUpdate = (StuffUpdate)this.Owner;
            //    frmStuffUpdate.FillMaterials();
            //}
            //if (this.Owner is StuffInsert)
            //{
            //    StuffInsert frmStuffInsert = (StuffInsert)this.Owner;
            //    frmStuffInsert.FillMaterials();
            //}

            this.Close();
        }
Example #14
0
        /// <summary>
        /// Saves the current composition on the print platform if the "Crtl S" combination is pressed
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        public void SaveAFile_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Modifiers == Keys.Control && e.KeyCode == Keys.S)
            {
                if (Main.main.current3Dview == Main.ThreeDViewOptions.gcode)
                {
                    StoreCode.Execute();
                }

                if (Main.main.current3Dview == Main.ThreeDViewOptions.STLeditor)
                {
                    if (Main.main.saveSTL.ShowDialog() == DialogResult.OK)
                    {
                        this.SaveComposition(Main.main.saveSTL.FileName);
                    }
                }

                e.Handled = true;
            }
        }