示例#1
0
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod

        #region  ExtensionMethod

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string User_Name)
        {
            return(dal.Exists(XYEEncoding.strCodeHex(User_Name)));
        }
示例#2
0
        private void buttonXEnter_Click(object sender, EventArgs e)
        {
            if (material == null)
            {
                if (!string.IsNullOrWhiteSpace(textBoxXName.Text))
                {
                    Model.Material material = new Model.Material();
                    material.Ma_Barcode = XYEEncoding.strCodeHex(textBoxXBarcode.Text.Trim());
                    material.Ma_Clear   = 1;
                    material.Ma_Code    = XYEEncoding.strCodeHex(BuildCode.ModuleCode("MA"));
                    if (dateTimeInputCreate.Text != "")
                    {
                        material.Ma_CreateDate = dateTimeInputCreate.Value.Date;
                    }
                    material.Ma_Enable = checkBoxXEnable.Checked ? 0 : 1;
                    if (dateTimeInputInput.Text != "")
                    {
                        material.Ma_InDate = dateTimeInputInput.Value.Date;
                    }
                    material.Ma_InPrice = Convert.ToDecimal(textBoxXInPrice.Text.Trim());
                    material.Ma_Model   = XYEEncoding.strCodeHex(textBoxXTypeModel.Text.Trim());
                    material.Ma_Name    = XYEEncoding.strCodeHex(textBoxXName.Text.Trim());
                    material.Ma_PicName = "";
                    material.Ma_Price   = Convert.ToDecimal(textBoxXOutPrice.Text.Trim());
                    material.Ma_PriceA  = Convert.ToDecimal(textBoxXPA.Text.Trim());
                    material.Ma_PriceB  = Convert.ToDecimal(textBoxXPB.Text.Trim());
                    material.Ma_PriceC  = Convert.ToDecimal(textBoxXPC.Text.Trim());
                    material.Ma_PriceD  = Convert.ToDecimal(textBoxXPD.Text.Trim());
                    material.Ma_PriceE  = 0;
                    material.Ma_Remark  = XYEEncoding.strCodeHex(textBoxXRemark.Text.Trim());
                    material.Ma_RFID    = XYEEncoding.strCodeHex(textBoxXRFID.Text.Trim());
                    if (comboBoxExSupplier.SelectedText != null &&
                        comboBoxExSupplier.SelectedValue != null)
                    {
                        material.Ma_SupID    = XYEEncoding.strCodeHex(comboBoxExSupplier.SelectedValue.ToString());
                        material.Ma_Supplier = XYEEncoding.strCodeHex(comboBoxExSupplier.SelectedText);
                    }
                    if (comboTreeType.SelectedNode != null)
                    {
                        material.Ma_TypeID   = XYEEncoding.strCodeHex(comboTreeType.SelectedNode.Tag.ToString());
                        material.Ma_TypeName = XYEEncoding.strCodeHex(comboTreeType.SelectedNode.FullPath.Replace(';', '/'));
                    }
                    material.Ma_Unit    = textBoxXUnit.Text.Trim();
                    material.Ma_zhujima = XYEEncoding.strCodeHex(textBoxXzhujima.Text.Trim());

                    MaterialManager mm = new MaterialManager();

                    try
                    {
                        int result = mm.Add(material);
                        if (result > 0)
                        {
                            MessageBox.Show("新增产品成功!");
                            MaterialForm mf = (MaterialForm)this.Owner;
                            mf.Isflag = true;
                        }
                        else
                        {
                            MessageBox.Show("更新失败,请检查服务器连接并尝试重新更新数据");
                        }
                        Close();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("新增产品出错,请检查服务器连接.错误:" + ex.Message);
                        Close();
                    }
                }
                else
                {
                    MessageBox.Show("货品名称不可为空,请注意 电影时间确实太短了,要把故事说全的话估计");
                }
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(textBoxXName.Text))
                {
                    material.Ma_Barcode = XYEEncoding.strCodeHex(textBoxXBarcode.Text.Trim());
                    if (dateTimeInputCreate.Text != "")
                    {
                        material.Ma_CreateDate = dateTimeInputCreate.Value;
                    }
                    if (dateTimeInputInput.Text != "")
                    {
                        material.Ma_InDate = dateTimeInputInput.Value;
                    }
                    material.Ma_InPrice = Convert.ToDecimal(textBoxXInPrice.Text.Trim());
                    material.Ma_Model   = XYEEncoding.strCodeHex(textBoxXTypeModel.Text.Trim());
                    material.Ma_Name    = XYEEncoding.strCodeHex(textBoxXName.Text.Trim());
                    material.Ma_Price   = Convert.ToDecimal(textBoxXOutPrice.Text.Trim());
                    material.Ma_PriceA  = Convert.ToDecimal(textBoxXPA.Text.Trim());
                    material.Ma_PriceB  = Convert.ToDecimal(textBoxXPB.Text.Trim());
                    material.Ma_PriceC  = Convert.ToDecimal(textBoxXPC.Text.Trim());
                    material.Ma_PriceD  = Convert.ToDecimal(textBoxXPD.Text.Trim());
                    material.Ma_PriceE  = 0;
                    material.Ma_Remark  = XYEEncoding.strCodeHex(textBoxXRemark.Text.Trim());
                    material.Ma_RFID    = XYEEncoding.strCodeHex(textBoxXRFID.Text.Trim());
                    if (comboBoxExSupplier.SelectedText != null &&
                        comboBoxExSupplier.SelectedValue != null)
                    {
                        material.Ma_SupID    = XYEEncoding.strCodeHex(comboBoxExSupplier.SelectedValue.ToString());
                        material.Ma_Supplier = XYEEncoding.strCodeHex(comboBoxExSupplier.SelectedText);
                    }
                    if (comboTreeType.SelectedNode != null)
                    {
                        material.Ma_TypeID   = XYEEncoding.strCodeHex(comboTreeType.SelectedNode.Tag.ToString());
                        material.Ma_TypeName = XYEEncoding.strCodeHex(comboTreeType.SelectedNode.FullPath.Replace(';', '/'));
                    }
                    material.Ma_Unit    = textBoxXUnit.Text.Trim();
                    material.Ma_zhujima = XYEEncoding.strCodeHex(textBoxXzhujima.Text.Trim());

                    MaterialManager mm = new MaterialManager();

                    try
                    {
                        bool result = mm.Update(material);
                        if (result)
                        {
                            MessageBox.Show("更新产品信息成功!");
                            MaterialForm mf = (MaterialForm)this.Owner;
                            mf.Isflag = true;
                        }
                        else
                        {
                            MessageBox.Show("更新失败,请检查服务器连接并尝试重新更新数据");
                        }
                        Close();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("更新产品出错,请检查服务器连接.错误:" + ex.Message);
                        Close();
                    }
                }
                else
                {
                    MessageBox.Show("货品名称不可为空,请注意");
                }
            }
        }
示例#3
0
        //TreeView的改变事件
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            string treeTag = treeView1.SelectedNode.Tag.ToString();

            superGridControl1.PrimaryGrid.DataSource = stock.GetList(" tm.Ma_TypeID='" + XYEEncoding.strCodeHex(treeTag) + "'");
        }
        /// <summary>
        /// 操作-删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SelectedElementCollection col = superGridControl1.PrimaryGrid.GetSelectedRows();
            int result = 0;

            if (col.Count > 0)
            {
                if (DialogResult.Yes == MessageBox.Show("确定全部删除吗? 删除后将不可恢复!", "WACAT管家", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1))
                {
                    GridRow row = col[0] as GridRow;
                    try
                    {
                        code   = row.Cells["gridColumn1"].Value.ToString();
                        result = sm.FalseDelClear(code);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("删除失败,请检查服务器连接并尝试重新删除.错误:" + ex.Message);
                    }

                    if (result > 0)
                    {
                        MessageBox.Show("删除成功!");
                        List <Supplier> list       = new List <Supplier>();
                        string          treeName   = treeView1.SelectedNode.Text;
                        string          searchType = toolStripComboBox2.Text.Trim();
                        string          searchKey  = XYEEncoding.strCodeHex(toolStripSelTxt.Text.Trim());
                        string          SQLWhere   = "";
                        if (treeView1.SelectedNode != null)
                        {
                            SQLWhere += string.Format("Su_Area like '%{0}%'", XYEEncoding.strCodeHex(treeName));
                        }
                        if (!string.IsNullOrWhiteSpace(toolStripSelTxt.Text.Trim()))
                        {
                            switch (searchType)
                            {
                            case "单位名称":
                                SQLWhere += string.Format(" and Su_Name like '%{0}%'", searchKey);
                                break;

                            case "联系人":
                                SQLWhere += string.Format(" and Su_Empname like '%{0}%'", searchKey);
                                break;

                            case "联系手机":
                                SQLWhere += string.Format(" and Su_EmpPhone like '%{0}%'", searchKey);
                                break;

                            case "常用电话":
                                SQLWhere += string.Format(" and Su_Phone like '%{0}%'", searchKey);
                                break;

                            default:
                                MessageBox.Show("类型选择错误,请重新选择!");
                                break;
                            }
                        }
                        try
                        {
                            list = sm.SelSupplierByWhere(SQLWhere);
                            superGridControl1.PrimaryGrid.DataSource = list;
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("加载数据失败,请检查服务器连接并尝试刷新.错误:" + ex.Message);
                        }
                    }
                    else
                    {
                        MessageBox.Show("删除失败!");
                        return;
                    }
                }
            }
            else
            {
                MessageBox.Show("请先选择一行!");
                return;
            }
        }
示例#5
0
        // 分页获取数据列表
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod

        #region  ExtensionMethod

        /// <summary>
        /// 假删除数据
        /// </summary>
        /// <param name="code">删除的编号</param>
        /// <returns></returns>
        public bool DeleteFake(string code)
        {
            return(dal.DeleteFake(XYEEncoding.strCodeHex(code)));
        }
示例#6
0
        //新增客户时把对应的客户折扣新增
        private void buttonXEnter_Click(object sender, EventArgs e)
        {
            //等于null为新增,不等于为更新
            if (client != null)
            {
                if (string.IsNullOrWhiteSpace(textBoxXName.Text) &&
                    string.IsNullOrWhiteSpace(textBoxXCompany.Text))
                {
                    MessageBox.Show("单位名称和客户名不可为空");
                    return;
                }
                Client        newClient = new Client();
                ClientManager cm        = new ClientManager();

                newClient.Cli_Code     = XYEEncoding.strCodeHex(client.Cli_Code);
                newClient.Cli_Name     = XYEEncoding.strCodeHex(textBoxXName.Text.Trim());
                newClient.Cli_Phone    = XYEEncoding.strCodeHex(textBoxXPhone.Text.Trim());
                newClient.Cli_PhoneTwo = XYEEncoding.strCodeHex(textBoxXPhone2.Text.Trim());
                newClient.Cli_LinkMan  = XYEEncoding.strCodeHex(textBoxXMan.Text.Trim());
                newClient.Cli_faxes    = XYEEncoding.strCodeHex(textBoxXFax.Text.Trim());
                newClient.Cli_Address  = XYEEncoding.strCodeHex(textBoxXAddress.Text.Trim());
                newClient.Cli_Company  = XYEEncoding.strCodeHex(textBoxXCompany.Text);

                newClient.Cli_CityCode = XYEEncoding.strCodeHex(comboTreeCity.SelectedNode == null ?
                                                                "" : comboTreeCity.SelectedNode.Tag.ToString());

                newClient.Cli_area = XYEEncoding.strCodeHex(comboTreeCity.SelectedNode == null ?
                                                            "" : comboTreeCity.SelectedNode.FullPath.Replace(";", "/"));

                newClient.Cli_TypeCode = XYEEncoding.strCodeHex(comboTreeType.SelectedNode == null ?
                                                                "" : comboTreeType.SelectedNode.Tag.ToString());

                newClient.Cli_TypeName = XYEEncoding.strCodeHex(comboTreeType.SelectedNode == null ?
                                                                "" : comboTreeType.SelectedNode.FullPath.Replace(";", "/"));

                newClient.Cli_Bankaccounts   = XYEEncoding.strCodeHex(textBoxXBankCode.Text.Trim());
                newClient.Cli_OpenBank       = XYEEncoding.strCodeHex(textBoxXBank.Text.Trim());
                newClient.Cli_Limit          = XYEEncoding.strCodeHex(textBoxXAmout.Text.Trim());
                newClient.Cli_ClearLimitdate = XYEEncoding.strCodeHex(integerInputDay.Value.ToString());
                newClient.Cli_Remark         = XYEEncoding.strCodeHex(textBoxXRemark.Text);

                newClient.Cli_zhiwen       = client.Cli_zhiwen;
                newClient.Cli_PicName      = client.Cli_PicName;
                newClient.Cli_DiscountCode = XYEEncoding.strCodeHex(client.Cli_DiscountCode);
                newClient.Cli_Olddata      = null;
                newClient.Cli_Oldreturn    = null;
                newClient.Cli_Newoutdata   = null;
                newClient.Cli_Newintodata  = null;
                newClient.Cli_Createdata   = client.Cli_Createdata;
                newClient.Cli_RemainLimit  = XYEEncoding.strCodeHex(newClient.Cli_Limit);
                newClient.Cli_ShouldMoney  = XYEEncoding.strCodeHex(client.Cli_ShouldMoney);
                newClient.Cli_GetMoney     = XYEEncoding.strCodeHex(client.Cli_GetMoney);
                newClient.Cli_PreMoney     = XYEEncoding.strCodeHex(client.Cli_PreMoney);
                newClient.Cli_safetone     = client.Cli_safetone;
                newClient.Cli_safettwo     = client.Cli_safettwo;

                newClient.Cli_Enable = 1;
                newClient.Cli_ID     = client.Cli_ID;

                try
                {
                    bool result = cm.UpdateByCode(newClient);
                    if (result)
                    {
                        MessageBox.Show("更新成功,数据已更改!");
                        ClientForm cf = (ClientForm)this.Owner;
                        cf.Isflag = true;
                    }
                    else
                    {
                        MessageBox.Show("更新失败,请检查服务器连接并尝试重新更新数据");
                    }
                    Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("异常:" + ex.Message);
                    Close();
                }
            }
            else
            {
                if (textBoxXCompany.Text.Trim() == "" ||
                    textBoxXName.Text.Trim() == "")
                {
                    MessageBox.Show("单位名称和客户名不可为空");
                }
                else
                {
                    if (checkBoxXDis.Checked && string.IsNullOrWhiteSpace(textBoxXDeadline.Text))
                    {
                        MessageBox.Show("若折扣有期限则需输入期限长度,若无期限请取消勾选");
                        return;
                    }

                    Discount d      = new Discount();
                    string   clcode = XYEEncoding.strCodeHex(BuildCode.ModuleCode("CL"));
                    string   dicode = XYEEncoding.strCodeHex(BuildCode.ModuleCode("DI"));

                    d.Dis_Code       = dicode;
                    d.Dis_ClientCode = clcode;
                    d.Dis_Name       = XYEEncoding.strCodeHex(textBoxXName.Text.Trim());
                    d.Dis_CreateDate = DateTime.Now;
                    if (checkBoxXDis.Checked)
                    {
                        int      number = Convert.ToInt32(textBoxXDeadline.Text.Trim());
                        DateTime tempD  = DateTime.Now;
                        switch (comboBoxExDeadline.Text)
                        {
                        case "年":
                            tempD.AddYears(number);
                            break;

                        case "月":
                            tempD.AddMonths(number);
                            break;

                        case "日":
                            tempD.AddDays(number);
                            break;
                        }
                        d.Dis_ClearDate = tempD;
                    }
                    else
                    {
                        d.Dis_ClearDate = null;
                    }
                    d.Dis_Enable   = 1;
                    d.Dis_Remark   = "";
                    d.Dis_Clear    = 1;
                    d.Dis_Discount = XYEEncoding.strCodeHex(textBoxXDisc.Text.Trim());

                    ClientManager cm = new ClientManager();
                    Client        c  = new Client();

                    c.Cli_Name     = XYEEncoding.strCodeHex(textBoxXName.Text.Trim());
                    c.Cli_Code     = clcode;
                    c.Cli_Phone    = XYEEncoding.strCodeHex(textBoxXPhone.Text.Trim());
                    c.Cli_PhoneTwo = XYEEncoding.strCodeHex(textBoxXPhone2.Text.Trim());
                    c.Cli_LinkMan  = XYEEncoding.strCodeHex(textBoxXMan.Text.Trim());
                    c.Cli_faxes    = XYEEncoding.strCodeHex(textBoxXFax.Text.Trim());
                    c.Cli_Address  = XYEEncoding.strCodeHex(textBoxXAddress.Text.Trim());

                    c.Cli_CityCode = XYEEncoding.strCodeHex(comboTreeCity.SelectedNode == null ?
                                                            "" : comboTreeCity.SelectedNode.Tag.ToString());

                    c.Cli_area = XYEEncoding.strCodeHex(comboTreeCity.SelectedNode == null ?
                                                        "" : comboTreeCity.SelectedNode.FullPath.Replace(";", "/"));

                    c.Cli_Company = XYEEncoding.strCodeHex(textBoxXCompany.Text);

                    c.Cli_TypeCode = XYEEncoding.strCodeHex(comboTreeType.SelectedNode == null ?
                                                            "" : comboTreeType.SelectedNode.Tag.ToString());

                    c.Cli_TypeName = XYEEncoding.strCodeHex(comboTreeType.SelectedNode == null ?
                                                            "" : comboTreeType.SelectedNode.FullPath.Replace(";", "/"));

                    c.Cli_DiscountCode   = XYEEncoding.strCodeHex(clcode);
                    c.Cli_Bankaccounts   = XYEEncoding.strCodeHex(textBoxXBankCode.Text.Trim());
                    c.Cli_OpenBank       = XYEEncoding.strCodeHex(textBoxXBank.Text.Trim());
                    c.Cli_Createdata     = DateTime.Now;
                    c.Cli_Limit          = XYEEncoding.strCodeHex(textBoxXAmout.Text.Trim());
                    c.Cli_RemainLimit    = c.Cli_Limit;
                    c.Cli_ClearLimitdate = XYEEncoding.strCodeHex(integerInputDay.Value.ToString());
                    c.Cli_ShouldMoney    = XYEEncoding.strCodeHex("0");
                    c.Cli_GetMoney       = XYEEncoding.strCodeHex(textBoxXAmout.Text.Trim());
                    c.Cli_PreMoney       = XYEEncoding.strCodeHex(textBoxXAmout.Text.Trim());
                    c.Cli_Remark         = XYEEncoding.strCodeHex(textBoxXRemark.Text);
                    c.Cli_Enable         = 1;
                    try
                    {
                        bool result = cm.AddClientAndDiscount(c, d);
                        if (result)
                        {
                            MessageBox.Show("添加客户成功");
                            ClientForm cf = (ClientForm)this.Owner;
                            cf.Isflag = true;
                            Close();
                        }
                        else
                        {
                            MessageBox.Show("添加客户失败,请检查服务器连接并重新添加");
                            Close();
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("更新失败,请检查错误:" + ex.Message);
                        Close();
                    }
                }
            }
        }
示例#7
0
        /// <summary>
        /// 根据商品名查询建议售价
        /// </summary>
        /// <param name="Ma_Name"></param>
        /// <returns></returns>
        public Material SelPriceByMaName(string Ma_Name)
        {
            string        sql      = string.Format("select * from T_Material where Ma_Name='{0}'", XYEEncoding.strCodeHex(Ma_Name));
            SqlDataReader read     = DbHelperSQL.ExecuteReader(sql);
            Material      material = new Material();
            DataSet       ds       = DbHelperSQL.Query(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
示例#8
0
 /// <summary>
 /// 绑定数据
 /// </summary>
 public void Band(string code)
 {
     try
     {
         this.superGridControl1.PrimaryGrid.DataSource = buypr.SelBuyDataTable(XYEEncoding.strCodeHex(code));
     }
     catch (Exception ex)
     {
         MessageBox.Show("错误代码:3213-物流信息列表数据初始化异常,异常信息:" + ex.Message);
     }
 }
        /// <summary>
        /// 根据编号查询信息 单条
        /// </summary>
        /// <param name="Ba_Code">编号</param>
        /// <returns></returns>
        public BankAccount SelBankAccountByCode(string Ba_Code)
        {
            string        sql  = string.Format("select top 1 * from T_BankAccount where Ba_Code='{0}'", XYEEncoding.strCodeHex(Ba_Code));
            SqlDataReader read = DbHelperSQL.ExecuteReader(sql);

            while (read.Read())
            {
                BankAccount BankAccount = new BankAccount()
                {
                    Ba_ID             = Convert.ToInt32(read["Ba_ID"]),
                    Ba_Code           = read["Ba_Code"].ToString(),
                    Ba_OpenBank       = read["Ba_OpenBank"].ToString(),
                    Ba_Account        = read["Ba_Account"].ToString(),
                    Ba_CardHolder     = read["Ba_CardHolder"].ToString(),
                    Ba_Remark         = read["Ba_Remark"].ToString(),
                    Ba_AvailablePrice = read["Ba_Remark"].ToString(),
                    Ba_Enable         = Convert.ToInt32(read["Ba_Enable"])
                };
                return(BankAccount);
            }
            return(null);
        }
示例#10
0
        private void dataGridViewFujia_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            switch (pbName)
            {
            case "pictureBox1":
                try
                {
                    ltxt_suname.Text      = dataGridViewFujia.Rows[e.RowIndex].Cells[1].Value.ToString();
                    txt_shif.Text         = dataGridViewFujia.Rows[e.RowIndex].Cells[2].Value.ToString();
                    txt_caigoucode.Text   = dataGridViewFujia.Rows[e.RowIndex].Cells[3].Value.ToString();
                    ltxt_AccountName.Text = dataGridViewFujia.Rows[e.RowIndex].Cells[4].Value.ToString();
                    DataTable dt = ch.DataTableReCoding(bpm.SelEmp(" buy.Buy_Code='" + XYEEncoding.strCodeHex(txt_caigoucode.Text) + "'").Tables[0]);
                    superGridControl1.PrimaryGrid.DataSource = dt;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("错误代码:3207-审核申请单选择框异常,异常信息:" + ex.Message);
                }
                break;

            case "pictureBox2":
                ltxt_AccountName.Text = dataGridViewFujia.Rows[e.RowIndex].Cells[1].Value.ToString();
                break;

            case "pictureBox3":
                ltxt_saleman.Text = dataGridViewFujia.Rows[e.RowIndex].Cells[1].Value.ToString();
                break;
            }
            resizablePanel1.Visible = false;
        }
示例#11
0
        private void InsSellGathering_Load(object sender, EventArgs e)
        {
            #region 初始化列
            GridColumn gc = null;

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_Code";
            gc.Name             = "Code";
            gc.HeaderText       = "销售单号";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_StockName";
            gc.Name             = "StockName";
            gc.HeaderText       = "仓库名称";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_MaID";
            gc.Name             = "MaID";
            gc.HeaderText       = "编码";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_MaName";
            gc.Name             = "MaName";
            gc.HeaderText       = "商品名称";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_Model";
            gc.Name             = "Model";
            gc.HeaderText       = "规格型号";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_Unit";
            gc.Name             = "Unit";
            gc.HeaderText       = "单位";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_DiscountBPrice";
            gc.Name             = "DiscountBPrice";
            gc.HeaderText       = "单价";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_CurNumber";
            gc.Name             = "CurNumber";
            gc.HeaderText       = "需求数量";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_ReNumber";
            gc.Name             = "ReNumber";
            gc.HeaderText       = "实发数量";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_LostNumber";
            gc.Name             = "LostNumber";
            gc.HeaderText       = "缺少数量";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_Discount";
            gc.Name             = "Discount";
            gc.HeaderText       = "折扣率";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_DiscountBPrice";
            gc.Name             = "DiscountBPrice";
            gc.HeaderText       = "折后金额";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_Money";
            gc.Name             = "Money";
            gc.HeaderText       = "总金额";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            gc = new GridColumn();
            gc.DataPropertyName = "Sell_Remark";
            gc.Name             = "Remark";
            gc.HeaderText       = "备注";
            superGridControl1.PrimaryGrid.Columns.Add(gc);

            superGridControl1.PrimaryGrid.DataSource = sdm.GetList(string.Format("Sell_Code='{0}'", XYEEncoding.strCodeHex(Sell_Code)));

            #endregion

            //ltxt_salecode.Text = Sell_Code; ;
            //ltxt_kehu.Text = C_ClientName;
            //ltxt_AccountName.Text = C_AccountName;
            //ltxt_yingshou.Text = C_AmountPay;

            ltxt_shishou.Text  = "0";
            ltxt_weishou.Text  = "0";
            ltxt_shoukuan.Text = "0";
            ltxt_yingshou.Text = "0";


            // ltxt_salecode.Text = _sellcode;
            Model.Sell sell = sm.SelSellGatheringBySellCode(ltxt_salecode.Text.Trim());
            ltxt_salecode.Text = _sellcode;
            ltxt_kehu.Text     = _Sell_ClientName;
            ltxt_yingshou.Text = Convert.ToDecimal(_OddMoney).ToString("0.00");
            ltxt_shoukuan.Text = Convert.ToDecimal(_InMoney).ToString("0.00");
            ltxt_weishou.Text  = Convert.ToDecimal(_LastMoney).ToString("0.00");
            ltxt_method.Text   = _fukuanfangshi;
            ltxt_saleman.Text  = _Salesman;
            ltxt_remark.Text   = _Remark;
            //if (sell != null)
            //{
            //    ltxt_salecode.Text = _sellcode;
            //    ltxt_kehu.Text = sell.Sell_ClientName;
            //    ltxt_AccountName.Text = sell.Sell_AccountCode;
            //    ltxt_yingshou.ReadOnly = true;
            //    ltxt_yingshou.Text = Convert.ToDecimal(sell.Sell_OddMoney).ToString("0.00");
            //    ltxt_shoukuan.Text = Convert.ToDecimal(sell.Sell_InMoney).ToString("0.00");
            //    ltxt_weishou.Text = Convert.ToDecimal(sell.Sell_LastMoney).ToString("0.00");
            //    ltxt_method.Text = sell.Sell_fukuanfangshi;
            //    ltxt_saleman.Text = sell.Sell_Salesman;
            //    ltxt_operation.Text = sell.Sell_Operation;
            //    ltxt_remark.Text = sell.Sell_Remark;
            //    ltxt_weishou.Text = sell.Sell_OddMoney;
            //}

            if (string.IsNullOrWhiteSpace(textBoxOddNumbers.Text))
            {
                textBoxOddNumbers.Text = BuildCode.ModuleCode("AC");
                conll.C_No             = textBoxOddNumbers.Text;//资金收款编号
            }
            //ltxt_salecode.Text
            //textBoxX1.Text = "0";
            //制单人
            LoginInfomation l = LoginInfomation.getInstance();
            l.UserName                 = "******";
            ltxt_operation.Text        = l.UserName;
            dataGridViewFujia.ReadOnly = true;
            dataGridViewFujia.AllowUserToResizeColumns = false; //是否可以调整列的大小
            dataGridViewFujia.AllowUserToResizeRows    = false; //是否可以调整行的大小
        }
示例#12
0
        /// <summary>
        /// 改名称
        /// </summary>
        /// <param name="PIC_Name">名称</param>
        /// <param name="PIC_Code">编号</param>
        /// <param name="FPIC_Name">之前的名称</param>
        /// <returns>受影响行数</returns>
        public int UpdateNameProjectCost(string PIC_Name, string PIC_Code, string FPIC_Name)
        {
            string sql = string.Format("update T_ProjectCost set PIC_Name='{0}' where PIC_Code='{1}' and PIC_Name='{2}' and PIC_Clear=1 and PIC_Enable=1", XYEEncoding.strCodeHex(PIC_Name), XYEEncoding.strCodeHex(PIC_Code), XYEEncoding.strCodeHex(FPIC_Name));

            return(DbHelperSQL.ExecuteSql(sql));
        }
示例#13
0
        /// <summary>
        /// 根据编号查询信息
        /// </summary>
        /// <param name="PIC_Code">编号</param>
        /// <returns>List集合</returns>
        public List <ProjectCost> SelProjectCostByCode(string PIC_Code)
        {
            List <ProjectCost> list = new List <ProjectCost>();
            string             sql  = string.Format("select * from T_ProjectCost where PIC_Code='{0}' and PIC_Clear=1 and PIC_Enable=1", XYEEncoding.strCodeHex(PIC_Code));
            SqlDataReader      read = DbHelperSQL.ExecuteReader(sql);

            while (read.Read())
            {
                ProjectCost pic = new ProjectCost()
                {
                    PC_ID       = Convert.ToInt32(read["PIC_ID"]),
                    PC_Name     = XYEEncoding.strHexDecode(read["PIC_Name"].ToString()),
                    PC_Code     = XYEEncoding.strHexDecode(read["PIC_Code"].ToString()),
                    PC_ParentId = XYEEncoding.strHexDecode(read["PIC_ParentId"].ToString()),
                    PC_Clear    = Convert.ToInt32(read["PIC_Clear"].ToString()),
                    PC_Enable   = Convert.ToInt32(read["PIC_Enable"].ToString())
                };
                list.Add(pic);
            }
            return(list);
        }
示例#14
0
        private void InsEmpolyee_Load(object sender, EventArgs e)
        {
            textBox2.Enabled        = false;
            comboBox1.SelectedIndex = 0;
            textBox11.Text          = DateTime.Now.ToString();
            comboBox1.DataSource    = dm.SelDepartment();
            comboBox1.DisplayMember = "Dt_Name";
            comboBox1.ValueMember   = "Dt_Code";
            //绑定角色下拉框
            DataTable dt = role.GetAllList().Tables[0];

            cbe_juese.DataSource    = dt;
            cbe_juese.DisplayMember = "Role_Name";
            cbe_juese.ValueMember   = "Role_Code";
            cbe_juese.SelectedIndex = 0;

            EmpolyeeForm empM = (EmpolyeeForm)Owner;

            try
            {
                switch (empM.StateType)
                {
                case 0:
                    textBox2.Text = BuildCode.ModuleCode("EMP");
                    break;

                case 1:
                    Model.Empolyee empolyee = em.SelEmpolyeeByCode(empM.id);

                    textBox1.Text = empolyee.Emp_Name;
                    textBox2.Text = empolyee.Emp_Code;
                    //获取选中的地址,绑定在地址的三个控件上面
                    string   str    = empolyee.Emp_Area;
                    string[] sArray = str.Split(new char[] { '/' });
                    tb_sheng.Text = sArray[0].ToString();
                    tb_shi.Text   = sArray[1].ToString();
                    tb_qu.Text    = sArray[2].ToString();
                    //
                    tb_pws.Text    = empolyee.Emp_Password;
                    textBox3.Text  = empolyee.Emp_CardCode;
                    textBox4.Text  = empolyee.Emp_Phone;
                    textBox5.Text  = empolyee.Emp_Card;
                    textBox6.Text  = empolyee.Emp_Birthday.ToString();
                    textBox7.Text  = empolyee.Emp_Email;
                    textBox8.Text  = empolyee.Emp_School;
                    textBox9.Text  = empolyee.Emp_Bank;
                    textBox10.Text = empolyee.Emp_OpenBank;
                    textBox11.Text = empolyee.Emp_Entry.ToString();
                    comboBox1.Text = XYEEncoding.strHexDecode(dm.SelDepartmentByCode(XYEEncoding.strCodeHex(empolyee.Emp_Depid)).Dt_Name);
                    //
                    cbe_juese.Text = XYEEncoding.strHexDecode(role.GetModel(XYEEncoding.strCodeHex(empolyee.Emp_UserRole)).Role_Name);
                    //
                    comboBox2.Text = empolyee.Emp_Education;
                    if (empolyee.Emp_Sex == "男")
                    {
                        radioButton1.Checked = true;
                    }
                    else
                    {
                        radioButton2.Checked = true;
                    }

                    if (empolyee.Emp_State == 0)
                    {
                        checkBox2.Checked = true;
                    }
                    if (empolyee.Emp_Enable == 0)
                    {
                        checkBox1.Checked = true;
                    }
                    break;

                default:
                    MessageBox.Show("类型错误!");
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("加载数据失败,请检查服务器连接并尝试刷新.错误:" + ex.Message);
            }
        }