Example #1
0
        private void but_costcenter_Click(object sender, EventArgs e)
        {
            if (dgv_01.Rows.Count != 0)
            {
                SortedList SLinfo = new SortedList();
                bool       ifde   = false;
                SLinfo.Add("ifsec", ifde);
                //部门ID
                SLinfo.Add("de_id", dgv_01.SelectedRows[0].Cells["id"].Value.ToString());
                //部门名称
                SLinfo.Add("de_name", dgv_01.SelectedRows[0].Cells["ca_name"].Value.ToString());
                //客户名称
                SLinfo.Add("cu_name", SLvalue["ca_name"].ToString());
                //客户Id
                SLinfo.Add("cu_id", SLvalue["id"].ToString());

                HCSCM_costcenter_department hcsm = new HCSCM_costcenter_department(SLinfo);
                //获取一个值,指是否在Windows任务栏中显示窗体。
                hcsm.ShowInTaskbar = false;
                hcsm.ShowDialog();
            }
            else
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("choicechange", EnumPromptMessage.warning, new string[] { "配置", "部门" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }
        private void but_department_Click(object sender, EventArgs e)
        {
            if (this.dgv_01.SelectedRows.Count <= 0)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("choicechange", EnumPromptMessage.warning, new string[] { "配置的", "成本中心" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            SortedList SLinfo = new SortedList();
            bool       ifcc   = true;

            SLinfo.Add("ifsec", ifcc);
            try
            {
                //成本中心ID
                SLinfo.Add("cc_id", dgv_01.SelectedRows[0].Cells["id"].Value.ToString());
                //成本中心名称
                SLinfo.Add("ca_name", dgv_01.SelectedRows[0].Cells["ca_name"].Value.ToString());
                //客户名称
                SLinfo.Add("cu_name", dgv_01.SelectedRows[0].Cells["cu_id"].Value.ToString());

                int customer = 0; //客户Id

                foreach (var key in sl_type01.Keys)
                {
                    if (sl_type01[key].ToString() == dgv_01.SelectedRows[0].Cells["cu_id"].Value.ToString())
                    {
                        customer = Convert.ToInt32(key);
                        break;
                    }
                }

                //客户名称
                SLinfo.Add("cu_id", customer);

                HCSCM_costcenter_department hcsm = new HCSCM_costcenter_department(SLinfo);
                //获取一个值,指是否在Windows任务栏中显示窗体。
                hcsm.ShowInTaskbar = false;

                hcsm.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("unknowerror", EnumPromptMessage.error, new string[] { ex.Message }), "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }