示例#1
0
 private void txtGBItemName_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         if (GBFormStatus == (int)EnumFormStatus.查询)
         {
             return;
         }
         string    itemname = string.Empty;
         string    sql      = "Select * from Data_ItemDts Where MainID=" + HTDataID.ToString();
         DataTable dts      = SysUtils.Fill(sql);
         if (dts.Rows.Count > 0)
         {
             for (int i = 0; i < dts.Rows.Count; i++)
             {
                 if (itemname != string.Empty)
                 {
                     itemname += " ";
                 }
                 itemname += dts.Rows[i]["DtsItemName"].ToString() + "" + dts.Rows[i]["Percentage"].ToString() + "%";
             }
         }
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
示例#2
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                BaseFocusLabel.Focus();
                if (this.HTFormStatus == FormStatus.新增)
                {
                    if (!CheckCorrect())
                    {
                        return;
                    }
                    int tempID = EntityAdd();
                    FCommon.AddDBLog(this.Text, "新增", "ID:" + tempID.ToString(), "");
                    this.HTDataID = tempID;
                }
                else if (this.HTFormStatus == FormStatus.修改)
                {
                    if (!CheckCorrect())
                    {
                        return;
                    }
                    EntityUpdate();
                    FCommon.AddDBLog(this.Text, "修改", "ID:" + HTDataID.ToString(), "");
                }

                SetFormStatus(FormStatus.查询);
                //EntitySet();
                SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
示例#3
0
        /// <summary>
        /// 恢复单据
        /// </summary>
        public virtual void btnFormRestore_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this._HTRightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (HTDataID == 0)
                {
                    this.ShowMessage("请选择要操作的记录");
                    return;
                }

                if (DialogResult.Yes != this.ShowConfirmMessage("确定恢复单据"))
                {
                    return;
                }

                if (!HTFormDelCheck(0))
                {
                    return;
                }

                HTFormRes(_HTDataTableName, _HTDataID.ToString());
                FCommon.AddDBLog(this.Text, "恢复单据", "ID:" + HTDataID.ToString(), "");
                SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                throw new Exception(E.Message);
            }
        }
示例#4
0
 /// <summary>
 /// 修改事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public override void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
         {
             this.ShowMessage("你没有此操作权限");
             return;
         }
         if (HTDataID == 0)
         {
             this.ShowMessage("请选择记录");
             return;
         }
         if (IsMake() != true)
         {
             this.ShowMessage("你没有此操作该单据权限");
             return;
         }
         this.NavigateWin(this.Name + "Edit", HTDataID.ToString(), FormStatus.修改);
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
示例#5
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                BaseFocusLabel.Focus();

                if (_doStatus == 1)
                {
                    int tempID = EntityAdd();
                    FCommon.AddDBLog(this.Text, "新增", "ID:" + tempID.ToString(), "");
                    this.HTDataID = tempID;
                }
                else if (_doStatus == 2)
                {
                    EntityUpdate();
                    FCommon.AddDBLog(this.Text, "修改", "ID:" + HTDataID.ToString(), "");
                }

                SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
示例#6
0
        /// <summary>
        /// 绑定打样信息汇总
        /// </summary>
        private void BindGrid7()
        {
            //ItemSampleRule rule = new ItemSampleRule();
            //DataTable dt = rule.RShow(" AND MainID=" + HTDataID + " ORDER BY Seq", ProcessGrid.GetQueryField(gridView6));
            string sql = string.Empty;

            sql = "EXEC USP1_Data_ItemGYFlowDts_Get " + HTDataID.ToString();
            DataTable dt = SysUtils.Fill(sql);

            gridView7.GridControl.DataSource = dt;
            gridView7.GridControl.Show();
        }
示例#7
0
 /// <summary>
 /// 浏览事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public override void btnBrowse_Click(object sender, EventArgs e)
 {
     try
     {
         if (HTDataID == 0)
         {
             this.ShowMessage("请选择记录");
             return;
         }
         this.NavigateWin(this.Name + "Edit", HTDataID.ToString(), FormStatus.查询);
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
示例#8
0
        /// <summary>
        /// 新增已存在事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnInsertExist_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }

                this.NavigateWin(this.Name + "Edit", HTDataID.ToString(), FormStatus.新增已存在);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
示例#9
0
        /// <summary>
        /// 外部窗体初始化数据
        /// </summary>
        /// <param name="p_OpenSourceID">打开窗体源实体ID</param>
        /// <param name="p_TargetID">打开窗体目标实体ID</param>
        public override void OutIniDataStrong(ArrayList p_SourceObject, string p_OpenSourceID, string p_TargetID, FormStatus p_MFormStatus) //右键菜单打开代码
        {
            try                                                                                                                             //赋值,父窗体,防止非查询结果集窗体
            {
                if (p_SourceObject != null)
                {
                    for (int i = 0; i < p_SourceObject.Count; i++)
                    {
                        switch (SysConvert.ToString(((ArrayList)p_SourceObject[i])[i]))
                        {
                            //case FUISourceObject.SourceForm://数据源Form
                            //    HTParentForm = (frmAPBaseUIWHForm)p_SourceForm;
                            //    break;
                        }
                    }
                }
            }
            catch
            {
            }

            if (p_OpenSourceID != string.Empty && p_OpenSourceID != HTDataID.ToString())
            {
                HTDataID = SysConvert.ToInt32(p_OpenSourceID);
                //EntitySet();

                SetPosStatus(HTDataID);
            }
            HTFormStatus = p_MFormStatus;
            switch (p_MFormStatus)
            {
            case FormStatus.新增:
                btnInsert_Click(null, null);
                break;

            case FormStatus.修改:
                btnUpdate_Click(null, null);
                break;

            default:
                SetFormStatus(p_MFormStatus);
                break;
            }
        }
示例#10
0
        /// <summary>
        /// 设计
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnDesign_Click(object sender, EventArgs e)
        {
            try
            {
                //base.btnDesign_Click(sender, e);
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.提交3))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (HTDataID == 0)
                {
                    this.ShowMessage("请选择要操作的记录");
                    return;
                }

                DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString());
                int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag);
                if (tempReportID == 0)
                {
                    this.ShowMessage("请选择报表模板");
                    return;
                }
                FastReportX.ReportRun(tempReportID, (int)ReportPrintType.设计, new string[] { "ID", "MainID" }, new string[] { HTDataID.ToString(), HTDataID.ToString() });
            }
            catch
            {
            }
        }
示例#11
0
        /// <summary>
        /// 浏览
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnPreview_Click(object sender, EventArgs e)
        {
            try
            {
                //base.btnPreview_Click(sender, e);
                if (HTDataID == 0)
                {
                    this.ShowMessage("请选择要操作的记录");
                    return;
                }

                DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString());
                int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag);
                if (tempReportID == 0)
                {
                    this.ShowMessage("请选择报表模板");
                    return;
                }
                FastReportX.ReportRun(tempReportID, (int)ReportPrintType.预览, new string[] { "ID", "MainID" }, new string[] { HTDataID.ToString(), HTDataID.ToString() });
            }
            catch
            {
            }
        }
示例#12
0
        /// <summary>
        /// 外部窗体初始化数据
        /// </summary>
        /// <param name="p_OpenSourceID">打开窗体源实体ID</param>
        /// <param name="p_TargetID">打开窗体目标实体ID</param>
        public override void OutIniDataStrong(ArrayList p_SourceObject, string p_OpenSourceID, string p_TargetID, FormStatus p_MFormStatus) //右键菜单打开代码
        {
            try                                                                                                                             //赋值,父窗体,防止非查询结果集窗体
            {
                if (p_SourceObject != null)
                {
                    for (int i = 0; i < p_SourceObject.Count; i++)
                    {
                        switch (SysConvert.ToString(((ArrayList)p_SourceObject[i])[i]))
                        {
                        case FUISourceObject.SourceForm:    //数据源Form
                            HTParentForm = (frmAPBaseUIWHForm)((ArrayList)p_SourceObject[i])[1];
                            if (HTParentForm != null)
                            {
                                if (HTParentForm.HTDataList != null && HTParentForm.HTDataList.GridControl != null && HTParentForm.HTDataList.GridControl.DataSource != null)
                                {
                                    _HTDataQueryResult = HTParentForm.HTDataList;
                                }
                                else
                                {
                                    _HTDataQueryResult = null;
                                }
                            }
                            else
                            {
                                _HTDataQueryResult = null;
                            }
                            break;

                        case FUISourceObject.SourceGridView:    //数据源Grid
                            _HTDataQueryResult = (GridView)((ArrayList)p_SourceObject[i])[1];
                            break;
                        }
                    }
                }
            }
            catch
            {
            }


            if (p_OpenSourceID != string.Empty && p_OpenSourceID != HTDataID.ToString())
            {
                HTDataID = SysConvert.ToInt32(p_OpenSourceID);
                //EntitySet();

                SetPosStatus(HTDataID);
            }
            HTFormStatus = p_MFormStatus;
            switch (p_MFormStatus)
            {
            case FormStatus.新增:
                btnInsert_Click(null, null);
                break;

            case FormStatus.修改:
                btnUpdate_Click(null, null);
                break;

            default:
                SetFormStatus(p_MFormStatus);
                break;
            }
        }