Beispiel #1
0
        protected void btnSetDesktopFlow_Click(object sender, EventArgs e)
        {
            String strIDs = this.GetSelectedItemID("Flow_ID");
            if (strIDs == "")
            {
                Response.Write("<script language='javascript'>window.alert('��ѡ��Ҫ���õ����̣�');</script>");
            }
            else
            {
                Response.Write("<script language='javascript'>window.alert('Ҫ���õĿ������:" + strIDs + "');</script>");
                string userName = Server.UrlDecode(Request.Cookies["UserName"].Value);
                ActiveRecord.Model.QuickFlow qf = new ActiveRecord.Model.QuickFlow();
                qf.StaffName = userName;
                qf.FlowIDs = strIDs;
                qf.Save();

                Response.Write("<script language='javascript'>window.alert('���õĿ�����̳ɹ�!');</script>");
            }
        }
Beispiel #2
0
        private void BandQuickFlow()
        {
            string userName = Server.UrlDecode(Request.Cookies["UserName"].Value);
            string flowids = "";
            ActiveRecord.Model.QuickFlow qf = new ActiveRecord.Model.QuickFlow().Find(userName);
            if (qf != null)
            {
                flowids = qf.FlowIDs;
            }
            if (flowids.Length > 0)
            {
                SqlDataReader dr = null; //存放人物的数据
                Database mySQL = new Database();
                try
                {
                    SqlParameter[] parameters = {
                                            mySQL.MakeInParam("@flowids",SqlDbType.VarChar ,300,flowids)
                                        };

                    mySQL.RunProc("sp_Desktop_GetQuickFlow", parameters, out dr);

                    DataTable dt = Tools.ConvertDataReaderToDataTable(dr);
                    //AddBlankRowInDataTable(5, ref dt);
                    //DataView dv = new DataView(dt);
                    if (dt.Rows.Count < 6)
                    {
                        int tmp = 6 - dt.Rows.Count;
                        for (int i = 0; i < tmp; i++)
                        {
                            DataRow myDataRow = dt.NewRow();

                            myDataRow[0] = "-";
                            dt.Rows.Add(myDataRow);

                        }
                    }
                    this.rptQuickFlow.DataSource = dt;
                    rptQuickFlow.DataBind();
                }
                finally
                {
                    if (mySQL != null)
                    {
                        mySQL.Close();
                    }
                    if (dr != null)
                    {
                        dr.Close();
                    }
                }
            }
            else //空白行
            {
                DataTable dt = new DataTable();
                DataColumn dc1 = new DataColumn("Flow_ID");
                DataColumn dc2 = new DataColumn("Flow_Name");
                dt.Columns.Add(dc1);
                dt.Columns.Add(dc2);
                if (dt.Rows.Count < 6)
                {
                    int tmp = 6 - dt.Rows.Count;
                    for (int i = 0; i < tmp; i++)
                    {
                        DataRow myDataRow = dt.NewRow();

                        myDataRow[0] = "-";
                        dt.Rows.Add(myDataRow);

                    }
                }
                this.rptQuickFlow.DataSource = dt;
                rptQuickFlow.DataBind();
            }
        }