Beispiel #1
0
        /// <summary>
        /// 新增 冷藏
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem13_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Frm_business02 frm_1 = new Frm_business02();

            frm_1.swapdata["dataset"]   = business_ds;
            frm_1.swapdata["SALESTYPE"] = "1";

            DialogResult result = frm_1.ShowDialog();

            if (result == DialogResult.OK)
            {
                string  s_itemId = frm_1.swapdata["ITEMID"].ToString();
                DataRow dr       = business_ds.Sa01.Rows.Add();
                dr["SA003"] = MiscAction.GetItemFullName(s_itemId);
                dr["SA002"] = "02";                                                                                  //类型:冷藏柜
                dr["SA004"] = s_itemId;
                dr["PRICE"] = MiscAction.GetItemFixPrice(s_itemId);                                                  //单价
                dr["SA005"] = "1";                                                                                   //临时性销售
                dr["NUMS"]  = Convert.ToDecimal(frm_1.swapdata["NUMS"]);                                             //数量
                dr["SA007"] = Convert.ToDecimal(dr["PRICE"]) * Convert.ToDecimal(dr["NUMS"]);                        //金额
                dr["SA020"] = "F";

                dr.EndEdit();
            }
            frm_1.Dispose();
            this.CalcSum();
        }
Beispiel #2
0
        private void barButtonItem14_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Frm_business03 frm_1 = new Frm_business03();

            frm_1.swapdata["dataset"]   = business_ds;
            frm_1.swapdata["SALESTYPE"] = "1";

            DialogResult result = frm_1.ShowDialog();

            if (result == DialogResult.OK)
            {
                List <string> itemId_list = frm_1.swapdata["xxs"] as List <string>;
                for (int i = 0; i < itemId_list.Count; i++)
                {
                    DataRow dr = business_ds.Sa01.Rows.Add();
                    dr["SA003"] = MiscAction.GetItemFullName(itemId_list[i]);
                    dr["SA002"] = "03";
                    dr["SA004"] = itemId_list[i];
                    dr["PRICE"] = MiscAction.GetItemFixPrice(itemId_list[i]);
                    dr["SA005"] = "1";
                    dr["NUMS"]  = 1;
                    dr["SA007"] = dr["PRICE"];
                    dr["SA020"] = MiscAction.GetItemInvoiceType(itemId_list[i]);
                    dr.EndEdit();
                }
            }
            frm_1.Dispose();
            this.CalcSum();
        }
Beispiel #3
0
        private void Frm_Register_Load(object sender, EventArgs e)
        {
            register_ds = this.swapdata["dataset"] as Register_ds;
            source      = this.swapdata["source"].ToString();

            if (source == "0")              //本馆火化寄存
            {
                ac001 = this.swapdata["AC001"].ToString();
                OracleDataReader reader = SqlAssist.ExecuteReader("select * from ac01 where ac001='" + ac001 + "'");
                while (reader.Read())
                {
                    txtEdit_rc001.EditValue = reader["AC001"];
                    txtEdit_rc003.EditValue = reader["AC003"];
                    rg_rc002.EditValue      = reader["AC002"];
                    txtEdit_rc004.EditValue = reader["AC004"];
                    txtedit_rc014.EditValue = reader["AC014"];
                    txtEdit_rc050.EditValue = reader["AC050"];
                    txtEdit_rc051.EditValue = reader["AC051"];
                    lookUp_rc052.EditValue  = reader["AC052"];
                    txtEdit_ac055.EditValue = reader["AC055"];
                }
            }

            lookup_sa004.DataSource    = register_ds.Jcfp;
            lookup_sa004.DisplayMember = "ITEM_TEXT";
            lookup_sa004.ValueMember   = "ITEM_ID";

            lookUp_rc052.Properties.DataSource    = register_ds.Relation;
            lookUp_rc052.Properties.ValueMember   = "ST003";
            lookUp_rc052.Properties.DisplayMember = "ST003";

            register_ds.Sa01.Rows.Clear();
            gridControl1.DataSource = register_ds.Sa01;

            //寄存所属套餐
            DataRow dr_new = null;

            foreach (DataRow r in register_ds.RegCombo.Rows)
            {
                dr_new          = register_ds.Sa01.NewRow();
                dr_new["SA004"] = r["CB021"];                   //商品或服务编号
                dr_new["PRICE"] = MiscAction.GetItemFixPrice(r["CB021"].ToString());
                dr_new["NUMS"]  = r["CB030"];
                dr_new["SA007"] = Convert.ToDecimal(dr_new["PRICE"]) * Convert.ToInt32(dr_new["NUMS"]);

                fpfee += Convert.ToDecimal(dr_new["SA007"]);
                register_ds.Sa01.Rows.Add(dr_new);
            }
            this.CalcHJ();
        }
Beispiel #4
0
        private void gridView2_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            int rowHandle = gridView2.FocusedRowHandle;

            if (e.Column.FieldName == "SA004" && e.Value != null && e.Value != System.DBNull.Value)
            {
                gridView2.SetRowCellValue(rowHandle, "PRICE", MiscAction.GetItemFixPrice(gridView2.GetRowCellValue(rowHandle, "SA004").ToString()));
                gridView2.SetRowCellValue(rowHandle, "NUMS", 1);
                calcFee(rowHandle);
            }
            else if (e.Column.FieldName == "PRICE" || e.Column.FieldName == "NUMS")
            {
                calcFee(rowHandle);
            }
            else if (e.Column.FieldName == "SA007")
            {
                fpfee = 0;
                for (int i = 0; i < gridView2.RowCount; i++)
                {
                    if (i == rowHandle)
                    {
                        fpfee += Convert.ToDecimal(e.Value);
                    }
                    else
                    {
                        if (gridView2.GetRowCellValue(i, "SA007") != null && gridView2.GetRowCellValue(i, "SA007") != System.DBNull.Value)
                        {
                            fpfee += Convert.ToDecimal(gridView2.GetRowCellValue(i, "SA007"));
                        }
                    }
                }
                ///// 如果是新行
                if (rowHandle < 0)
                {
                    fpfee += Convert.ToDecimal(e.Value);
                }

                if (!string.IsNullOrEmpty(comboBox1.Text))
                {
                    this.Calc_Hj(Convert.ToInt32(comboBox1.Text));
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// 休息室办理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BarButtonItem6_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int            re;
            Frm_business03 frm_xxs = new Frm_business03();

            frm_xxs.swapdata["businessObject"] = this;
            frm_xxs.swapdata["dataset"]        = sa01_ds;


            if (frm_xxs.ShowDialog() == DialogResult.OK)
            {
                List <string> itemIdList = this.swapdata["xxs"] as List <string>;
                foreach (string s in itemIdList)
                {
                    re = gridView1.LocateByValue("SA004", s);
                    if (re >= 0)
                    {
                        if (MessageBox.Show("【" + gridView1.GetRowCellValue(re, "SA003").ToString() + "】已经存在,要替换吗?",
                                            "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                        {
                            continue;
                        }
                        gridView1.DeleteRow(re);
                    }

                    DataRow dr = sa01_ds.Sa01.Rows.Add();
                    dr["SA003"] = MiscAction.GetItemFullName(s);
                    dr["SA002"] = "03";                                                 //类型:休息室
                    dr["SA004"] = s;
                    dr["PRICE"] = MiscAction.GetItemFixPrice(s);                        //单价
                    dr["SA005"] = "1";                                                  //临时性销售
                    dr["NUMS"]  = 1;
                    dr["SA007"] = dr["PRICE"];

                    dr.EndEdit();
                }
            }
        }