Ejemplo n.º 1
0
    protected void CustomTableRep_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        DataTable dt = new DataTable();
        dt = BCustomFormField.GetTitleList(CustomFormId);

        if (e.Item.ItemType == ListItemType.Header)
        {
            //列举出所有的字段当头部
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                sb.Append("<td>"+dt.Rows[i]["Alias"].ToString()+"</td>");
            }
            (e.Item.FindControl("lit_head") as Literal).Text = sb.ToString();
        }

        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)
        {
            //行ID
            int Id = int.Parse((e.Item.FindControl("CustomFormFieldId") as Label).Text);
            drInfo = BInfoOper.GetInfo(MCustomForm.TableName, Id);

            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                sb.Append("<td>" + Function.Encode(drInfo["" + dt.Rows[i]["Name"].ToString() + ""].ToString()) + "</td>");
            }
            (e.Item.FindControl("lit_item") as Literal).Text = sb.ToString();
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (((CareerCruisingWeb.PageBase.IndividualBase)Page).IsArchived || ((CareerCruisingWeb.PageBase.SuperBase)Page).ToolTypeID == "2")
        {
            loginID = CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("LoginID");

            portInfoRow = (DataRow)Session["PortInfo"];

            // get database name
            ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName = CareerCruisingWeb.CCLib.Common.Strings.GetDatabaseName();

            string commandText = "select AnnualReviewAdvisorID, AnnualReviewDate, AnnualReviewComment, AnnualReviewAdvisorComment, AnnualReviewBL from " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "PCS_Status_" + ((CareerCruisingWeb.PageBase.IndividualBase)Page).GetPortStateCode() + " where PortfolioID=" + portInfoRow["PortfolioID"];

            pcsStatusTable = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable(commandText);

            if (pcsStatusTable.Rows.Count > 0)
            {
                pcsStatus = pcsStatusTable.Rows[0];

                if (pcsStatus["AnnualReviewAdvisorID"].ToString() != "")
                    strAdvisorName = CareerCruisingWeb.CCLib.Common.DataAccess.GetValue("select FirstName+' '+LastName as FullName from " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "PortfolioAdminNames where AdminID=" + pcsStatus["AnnualReviewAdvisorID"].ToString()).ToString();
                else
                    strAdvisorName = "";
            }
        }
    }
Ejemplo n.º 3
0
		internal Key(DataTable table,DataColumn[] columns,ListSortDirection[] sort, DataViewRowState rowState, IExpression filter)
		{
			_table = table;
			_filter = filter;
			if (_filter != null)
				_tmpRow = _table.NewNotInitializedRow();
			_columns = columns;
			if (sort != null && sort.Length == columns.Length) {
				_sortDirection = sort;
			}
			else {
				_sortDirection = new ListSortDirection[columns.Length];
				for(int i=0; i < _sortDirection.Length; i++) {
					_sortDirection[i] = ListSortDirection.Ascending;
				}
			}

			if (rowState != DataViewRowState.None) {
				_rowStateFilter = rowState;
			}
			else {
				// FIXME : what is the correct value ?
				_rowStateFilter = DataViewRowState.CurrentRows;
			}
		}
    protected string GetIncidentStatus(DataRow row, int indexStatus, int indexUser, int incidentId)
    {
        string display = String.Empty;
        string text = (string)row.ItemArray[indexStatus];
        switch (text)
        {
            case "Assigned":
            {
                //get associated userName from aspnet_Users
                string sqlSelect = "SELECT u.UserName "
                    + "FROM aspnet_Users u, ajjp_Incidents i "
                    + "WHERE u.UserId = i.AssignedUserId "
                    + "AND i.IncidentId = '" + incidentId + "'";

                DataTable userName = DataTypeHandler.GetDataTable(sqlSelect);
                //lblErr.Text += sqlSelect;

                display = "Assigned: " + (string)userName.Rows[0].ItemArray[0];
                break;
            }
            case "Closed":
            {
                display = "Status: Closed";
                break;
            }
            case "Open":
            {
                display = "Status: Open";
                break;
            }
        }
        return display;
    }
Ejemplo n.º 5
0
    //protected string strLink = CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("RURL");
    protected void Page_Load(object sender, EventArgs e)
    {
        if (strLanguage == "") strLanguage = "English";
        System.Web.HttpContext.Current.Cache.Remove("CPStudentInfo_" + strPortfolioID);
        DataTable dt;
        dt = CareerCruisingWeb.CCLib.SqlHelper.GetDataTable(ConfigurationManager.AppSettings["strConLocal"], "SELECT PortfolioID FROM Portfolio WHERE CCGUID='" + strCCGUID + "'");
        if (dt.Rows.Count == 0)
        {
            Response.Write("Invalid Student Reference Number");
            Response.End();
        }
        strPortfolioID = dt.Rows[0][0].ToString();

        dt = CareerCruisingWeb.CCLib.SqlHelper.GetDataTable(ConfigurationManager.AppSettings["strConLocal"], "EXEC CP_StudentInfo " + strPortfolioID);
        drCPStudentInfo = dt.Rows[0];

        dt = CareerCruisingWeb.CCLib.SqlHelper.GetDataTable(ConfigurationManager.AppSettings["strConLocal"], "EXEC CP_SchoolInfo " + drCPStudentInfo["HighSchoolID"].ToString());
        drCPSchoolInfo = dt.Rows[0];

        AuthorizeSheet1.PortfolioID = strPortfolioID;
        AuthorizeSheet1.CPStudentInfo = drCPStudentInfo;
        AuthorizeSheet1.CPSchoolInfo = drCPSchoolInfo;
        AuthorizeSheet1.strLanguage = strLanguage;
        AuthorizeSheet1.AdminId = "0";
    }
Ejemplo n.º 6
0
    protected string GetAthleticsAssociationInfo(DataRow schoolInfo)
    {
        string athleticsAssociationInfo = "";

        switch (schoolInfo["assn_athl_ncaa"].ToString())
        {
            case "1":
                athleticsAssociationInfo = "National College Athletic Association (NCAA) Division 1<br>";
                break;
            case "2":
                athleticsAssociationInfo = "National College Athletic Association (NCAA) Division 2<br>";
                break;
            case "3":
                athleticsAssociationInfo = "National College Athletic Association (NCAA) Division 3<br>";
                break;
            case "X":
                athleticsAssociationInfo = "NCAA<br>";
                break;
        }

        if (schoolInfo["assn_athl_naia"].ToString() == "X")
            athleticsAssociationInfo += "National Association of Intercollegiate Athletics (NAIA)<br>";

        if (schoolInfo["assn_athl_nccaa"].ToString() == "X")
            athleticsAssociationInfo += "National Christian College Athletic Association (NCCAA)<br>";

        if (schoolInfo["assn_athl_nscaa"].ToString() == "X")
            athleticsAssociationInfo += "National Small College Athletic Association (NSCAA)<br>";

        if (schoolInfo["assn_athl_njcaa"].ToString() == "X")
            athleticsAssociationInfo += "National Junior College Athletic Association (NJCAA)<br>";

        return athleticsAssociationInfo;
    }
Ejemplo n.º 7
0
    public Deck(DataRow rawData)
    {
        this.rawData = rawData;

        id = (int)rawData["id"];
        cardsStr = rawData["cards"].ToString();
    }
Ejemplo n.º 8
0
Archivo: User.cs Proyecto: yum-kvn/kage
    public User(DataRow rawData)
    {
        this.rawData = rawData;

        id = (int)rawData["id"];
        stageId = (int)rawData["stage_id"];
    }
Ejemplo n.º 9
0
 public PessoaFisica(DataRow row)
 {
     this._id = Convert.ToInt32(row["id"]);
     this._pessoa = new Pessoa(Convert.ToInt32(row["idpessoa"]));
     this._acesso = new Acesso(Convert.ToInt32(row["idacesso"]));
     this._cpf = row["cpf"].ToString();
 }
Ejemplo n.º 10
0
 public Basico(DataRow row)
 {
     this._id = Convert.ToInt32(row["id"]);
     this._cadastro = Convert.ToDateTime(row["cadastro"]);
     this._atualizacao = Convert.ToDateTime(row["atualizacao"]);
     this._ativo = Convert.ToBoolean(row["ativo"]);
 }
        private static bool AssignableMatch(DataRow row, Type connectionType)
        {
            DebugCheck.NotNull(row);
            DebugCheck.NotNull(connectionType);

            return connectionType.IsInstanceOfType(DbProviderFactories.GetFactory(row).CreateConnection());
        }
    private bool fromScreenToEntityProducts(DataRow dr)
    {
        try
        {
            dr["productid"] = Int32.Parse(lbProductId.Text);
            dr["productcategoryId"] = lbSesProdfiletOneId.Text;
            dr["merchantId"] = lbMerchantId.Text;
            dr["discription"] = tbItemDescription.Text;
            dr["price"] =Int32.Parse(tbPrice.Text);
            dr["quantity"] = Int32.Parse(tbQuantity.Text);
            dr["sellingleadId"] = Int32.Parse(ddlSellinlead.SelectedValue);
            dr["comment"] = TextBoxComment.Text;
            dr["productoptionone"] = tbProductoptionone.Text;
            dr["productoptiontwo"] = tbProductoptiontwo.Text;
            dr["productoptionthree"] = tbProductoptionthree.Text;
            dr["productoptionfour"] = tbProductoptionfour.Text;
            dr["productoptionfive"] = tbProductoptionfive.Text;
            dr["productoptionsix"] = tbProductoptionsix.Text;
            

            return true;
        }
        catch
        {
            LabelErr.Text = "Values are not correct.";
        }
        return false;
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region Initialize Values
        CPStudentInfo = ((CareerCruisingWeb.PageBase.SuperBase)Page).CPStudentInfo;
        CPSchoolInfo = ((CareerCruisingWeb.PageBase.SuperBase)Page).CPSchoolInfo;
        strSchoolID = CPStudentInfo["HighSchoolID"].ToString();
        blAdmin = (Parent.AppRelativeTemplateSourceDirectory.ToLower() == "~/school/") ? true : false;
        if (blAdmin)
        { strPortfolioID = CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("PortfolioID"); }
        else
        {
            PortInfo = ((CareerCruisingWeb.PageBase.SuperBase)Page).PortInfo;
            strPortfolioID = PortInfo["PortfolioID"].ToString();
        }
        strLink = (blAdmin) ? "PortfolioID=" + strPortfolioID : "LoginID=" + Request.QueryString["LoginID"];
        strEducationPlanSection = (CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("S").Length > 0) ? CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("S") : "1";
        #endregion

        if (!IsPostBack)
        {
            strSQL = "SELECT DegreeID, Name, Description FROM CP_Degree WHERE SchoolId = " + strSchoolID + " and DegreeID = " + strDegreeID;
            DataTable dtbData = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable(strSQL);
            if (dtbData.Rows.Count > 0)
            {
                lblDegreeName.Text = dtbData.Rows[0]["Name"].ToString();
                Literal1.Text = dtbData.Rows[0]["Description"].ToString();
            }

        }
    }
Ejemplo n.º 14
0
 public static IDandDescr Load(DataRow row, string id_name, string descr_name)
 {
     return new IDandDescr(
         Convert.ToInt32(row[id_name]),
         Convert.ToString(row[descr_name])
     );
 }
Ejemplo n.º 15
0
 private static void CopyRow(dsPedido.PedidoRow dr, DataRow row, string sTabelaFilho)
 {
     dr.DT_PEDIDO = row["DT_PEDIDO"].ToString();
     dr.CD_CLIENTE = row["CD_CLIENTE"].ToString();
     dr.NM_CLIFOR = row["NM_CLIFOR"].ToString();
     //dr.DS_ENDCLI = row["DS_ENDCLI"].ToString();
     dr.NM_BAIRROCLI = row["NM_BAIRROCLI"].ToString();
     dr.NM_CIDCLI = "";// row["NM_CIDCLI"].ToString();
     dr.CD_UFCLI = row["CD_UFCLI"].ToString();
     dr.CD_CEPCLI = row["CD_CEPCLI"].ToString();
     dr.CD_FONECLI = row["CD_FONECLI"].ToString();
     dr.DS_PRAZO = row["DS_PRAZO"].ToString();
     dr.DS_PROD = row["DS_PROD"].ToString();
     dr.VL_UNIPROD = row["VL_UNIPROD"].ToString();
     dr.QT_PROD = row["QT_PROD"].ToString();
     dr.NM_VENDEDOR = row["NM_VENDEDOR"].ToString();
     dr.CD_PEDCLI = row["CD_PEDCLI"].ToString();
     dr.CD_FONEVEND = row["CD_FONEVEND"].ToString();
     dr.DS_TIPODOC = row["DS_TIPODOC"].ToString();
     dr.ST_PEDIDO = row["ST_PEDIDO"].ToString();
     if (dr.ST_PEDIDO == "F")
     {
         dr.ST_PEDIDO = "Faturado-NFe: " + row["CD_NFSEQ"].ToString(); // utilizado esse campo pois não foi possivel atualizar o dataset do relatório
     }
     else
     {
         dr.ST_PEDIDO = "Pendente";
     }
     dr.VL_DESC = row["VL_DESCONTO_VALOR"].ToString();
     if (sTabelaFilho.Equals("MOVIPEND"))
         dr.NM_CIDCLI = row["DS_COR"].ToString();
     dr.CD_PROD = row["CD_PROD"].ToString();
 }
Ejemplo n.º 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region Check Login
        CheckRegionAdminSession();
        #endregion Check Login

        #region Initialize Values and Form Execution

        // retrieve querystring used to populate student list
        studentListQuerystring = Session["StuListQueryString"].ToString();

        portfolioID = CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("PortfolioID");

        string command = "SELECT firstname, lastname FROM portfolio WHERE PortfolioID = " + portfolioID; // +" and schoolid = " + schoolID;

        userInfo = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable(command).Rows[0];

        // call method used to bind and display notes on page
        BindNotesRepeater();

        #endregion Initialize Values and Form Execution

        #region Properties For The Region Base Class
        TitleBar = "View Notes";
        SubTitleBar = "View Notes";
        #endregion Properties For The Region Base Class
    }
Ejemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (strLanguage == "") strLanguage = "English";
        System.Web.HttpContext.Current.Cache.Remove("CPStudentInfo_" + strPortfolioID);
        DataTable dt;
        dt = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable("SELECT PortfolioID FROM Portfolio WHERE CCGUID='" + strCCGUID + "'");
        if (dt.Rows.Count == 0)
        {
            Response.Write("Invalid Student Reference Number");
            Response.End();
        }
        strPortfolioID = dt.Rows[0][0].ToString();

        dt = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable("EXEC CP_StudentInfo " + strPortfolioID);
        drCPStudentInfo = dt.Rows[0];

        dt = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable("EXEC CP_SchoolInfo " + drCPStudentInfo["HighSchoolID"].ToString());
        drCPSchoolInfo = dt.Rows[0];

        AuthorizeSheetConEd1.PortfolioID = strPortfolioID;
        AuthorizeSheetConEd1.CPStudentInfo = drCPStudentInfo;
        AuthorizeSheetConEd1.CPSchoolInfo = drCPSchoolInfo;
        AuthorizeSheetConEd1.strLanguage = strLanguage;
        AuthorizeSheetConEd1.AdminId = "0";
        AuthorizeSheetConEd1.strConEdLabel = CP.ShowCustomLabel("165", drCPStudentInfo["HighSchoolID"].ToString(), strLanguage);
    }
Ejemplo n.º 18
0
    public DataTable ReadUserInfo(string str)
    {
        if (bll.GetCookie() == null)
        {
            return null;
        }
        else
        {
            int UserId = bll.GetCookie().UserID;

            DataTable dt = new DataTable();
            try
            {
                dr = bll.GetUserAllInfo(UserId);
                dt = dr.Table.Copy();
                dt.Clear();
                dt.ImportRow(dr);
            }
            catch (Exception ex)
            {
                Response.Write(ex);
            }
            return dt;
        }
    }
Ejemplo n.º 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (((CareerCruisingWeb.PageBase.IndividualBase)Page).IsArchived || ((CareerCruisingWeb.PageBase.SuperBase)Page).ToolTypeID == "2")
        {
            loginID = CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("LoginID");

            portInfoRow = (DataRow)Session["PortInfo"];

            // get database name
            ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName = CareerCruisingWeb.CCLib.Common.Strings.GetDatabaseName();

            strSubSection = (CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("SubSection") == "") ? "List" : CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("SubSection");
            //form post and execution
            if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
            {
                //delete MatchMaker
                //string strSavedMatchMakerID = CCLib.Common.Strings.GetFormString("SavedMatchMakerID");
                //if (strSavedMatchMakerID != "")
                //{
                //    CCLib.Common.DataAccess.ExecuteNonQuery("delete from Port_SavedMatchMaker where SavedMatchMakerID=" + strSavedMatchMakerID + " and PortfolioID=" + PortInfo["PortfolioID"].ToString());
                //    UpdatePCSStatusFromSection("MatchMaker");
                //}
            }

            //generate values
            dtMatchMaker = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable("select * from " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "Port_SavedMatchMaker where PortfolioID=" + portInfoRow["PortfolioID"].ToString());
            if (dtMatchMaker.Rows.Count > 0 && dtMatchMaker.Rows[0]["OccNumbers"].ToString() != "")
            {
                strsOccNumbers = dtMatchMaker.Rows[0]["OccNumbers"].ToString().Split(new char[] { ';' });
            }
        }
    }
Ejemplo n.º 20
0
 public static StaffPosition Load(DataRow row, string prefix="")
 {
     return new StaffPosition(
         Convert.ToInt32(row[prefix+"staff_position_id"]),
         Convert.ToString(row[prefix+"descr"])
     );
 }
Ejemplo n.º 21
0
 private static RoleEntity ConvertRoleEntity(DataRow dr)
 {
     RoleEntity entity = new RoleEntity();
     entity.RoleID = Convert.ToString(dr["UserRoleID"]).Trim();
     entity.RoleName = Convert.ToString(dr["UserRoleName"]).Trim();
     return entity;
 }
Ejemplo n.º 22
0
 public Item(DataRow row)
 {
     foreach(DataColumn c in row.Table.Columns)
     {
       hash[c.ColumnName] = row[c.ColumnName];
     }
 }
Ejemplo n.º 23
0
 public Questao(DataRow row)
 {
     this._id = Convert.ToInt32(row["id"]);
     this._basico = new Basico(Convert.ToInt32(row["idbasico"]));
     this._idAvaliacao = Convert.ToInt32(row["idavaliacao"]);
     this._questao = row["questao"].ToString();
 }
Ejemplo n.º 24
0
    //добавление данных в таблицу справочников
    void AddROW(DataRow NewRow)
    {
        DataTable DIR;
           if(ReaderXML.TableExist(NameDirectory))
           {
               //если файл существует то загружаем таблицу
               DIR = ReaderXML.LoadDataTablefromXML(NameDirectory);
               //добавляем уникальные записи к существующим в таблице
               if (ReaderXML.ExistRow("IDS='" + NewRow["IDS"].ToString() + "'", NameDirectory))
               {
                   //создаем строку для добавления в таблицу
                   DataRow M = CreateRow(DIR, NewRow);
                   //добавляем запись в табличку
                   DIR.Rows.Add(M);
                   //Сохраняем табличку
                   ReaderXML.SaveDataTableInXML(DIR);
                   Console.Write(" добавлен");
               }
               else Console.Write(" уже есть");

           }else
           {
                //создаем нову таблицу
               DIR = InitFormTable();
                //создаем строку для добавления в таблицу
                DataRow M = CreateRow(DIR, NewRow);
               //добавляем запись в табличку
                DIR.Rows.Add(M);
               //Сохраняем табличку
                ReaderXML.SaveDataTableInXML(DIR);
           }
    }
Ejemplo n.º 25
0
    public Armor.ArmorParameter GetArmorParameter(DataRow row = null)
    {
        Armor.ArmorParameter res = new Armor.ArmorParameter();
        if (row == null) return res;
        res.Name = row.Select("Name").ToString();
        res.CreateTime = float.Parse(row.Select("CreateTime").ToString());
        res.Armor = float.Parse(row.Select("Armor").ToString());

                //parameters
        if (row.Select("PNumber").ToString() != "")
        res.PNumber = int.Parse(row.Select("PNumber").ToString());
        if (row.Select("PPercentage").ToString() != "")
        res.PPercentage = float.Parse(row.Select("PPercentage").ToString());
        if (row.Select("PTime").ToString() != "")
        res.PTime = float.Parse(row.Select("PTime").ToString());
        if (row.Select("PRange").ToString() != "")
        res.PRange = float.Parse(row.Select("PRange").ToString());
        if (row.Select("PDamage").ToString() != "")
        res.PDamage = float.Parse(row.Select("PDamage").ToString());
        if (row.Select("Parameter1").ToString() != "")
        res.Parameter1 = row.Select("Parameter1").ToString();
        if (row.Select("Parameter2").ToString() != "")
        res.Parameter2 = row.Select("Parameter1").ToString();

        //info
        res.Info = row.Select("Info").ToString();
        return res;
    }
        private static bool ExactMatch(DataRow row, Type connectionType)
        {
            DebugCheck.NotNull(row);
            DebugCheck.NotNull(connectionType);

            return DbProviderFactories.GetFactory(row).CreateConnection().GetType() == connectionType;
        }
Ejemplo n.º 27
0
 public static ProductImageItem FillOne(DataRow r, IncludeToFill inc)
 {
     ProductImageItem p = new ProductImageItem();
     if (inc.Id) p.Id = (int)r["Id"];
     if (inc.ImageUrl) p.ImageURL = (string)r["ImageURL"];
     return p;
 }
Ejemplo n.º 28
0
    protected Int32 DetermineStudentRecipientCount(DataRow CriteriaRow)
    {
        System.Text.StringBuilder sbSQL = new System.Text.StringBuilder();
        sbSQL.Append("select count(portfolioid) from PortfolioUserInfo where active=1 and ConSysID=" + _ConSysID);

        //Gender
        string strGenderSQL = RemoveTrailingComma(CriteriaRow["Cri_Gender"].ToString());
        string strGradeSQL = RemoveTrailingComma(CriteriaRow["Cri_Grades"].ToString());
        string strCountySQL = RemoveTrailingComma(CriteriaRow["Cri_Counties"].ToString());
        string strSchoolSQL = RemoveTrailingComma(CriteriaRow["Cri_Schools"].ToString());
        string strCareerSQL = RemoveTrailingComma(CriteriaRow["Cri_Careers"].ToString());
        string strClusterSQL = RemoveTrailingComma(CriteriaRow["Cri_Clusters"].ToString());
        string strCompanySQL = "";
        if (_MessageTypeID == 3)
            strCompanySQL = (CriteriaRow["Cri_Company"].ToString() == "True") ? CriteriaRow["CompanyID"].ToString() : "";

        if ((strGenderSQL != "All") && (strGenderSQL.Trim() != "1,0"))
          sbSQL.Append(" and GenderID in (" + strGenderSQL + ")");
        if (strGradeSQL != "All")
            sbSQL.Append(" and GradeNumber in (" + strGradeSQL + ")");
        if (strSchoolSQL != "All")
            sbSQL.Append(" and SchoolID in (" + strSchoolSQL + ")");
        if (strCountySQL != "All")
            sbSQL.Append(" and CountyID in (" + strCountySQL + ")");
        if (strCareerSQL != "All")
            sbSQL.Append(" and PortfolioID in (Select PortfolioID from Port_SavedCareers where OccNumber in (" + strCareerSQL + "))");
        if (strClusterSQL != "All")
            sbSQL.Append(" and PortfolioID in (Select PortfolioID from Port_ClusterInterests where ClusterID in (" + strClusterSQL + "))");
        if (strCompanySQL.Length > 0)
            sbSQL.Append(" and PortfolioID in (Select PortfolioID from Port_SavedCompanies where CompanyID = " + strCompanySQL + ")");

        string strTempCount = CareerCruisingWeb.CCLib.Common.DataAccess.GetValue(sbSQL.ToString()).ToString();

        return Convert.ToInt32(strTempCount);
    }
Ejemplo n.º 29
0
        public DataTable TotalTimeResult(string Stcode, DateTime TermTimeStart, DateTime TermTimeEnd, string tterm)
        {
            DataTable DT1=new DataTable();
            DataTable DT2 = new DataTable();

            if (tterm == "93-94-1")
            {
                DT1 = GetTotalTime_Old(Stcode, TermTimeStart, TermTimeEnd);
                DT2 = GetTotalTime(Stcode, TermTimeStart, TermTimeEnd);
                foreach (DataRow item in DT2.Rows)
                    DT1.Rows.Add(item.ItemArray);
            }
            if (tterm == "93-94-2")
            {
                DateTime Start = new DateTime(2015, 02, 01);
                DateTime End = new DateTime(2015, 08, 22);
                DT1 = spDAO.GetTotalTime(Stcode, Start, End, tterm);
            }
            if (tterm == "93-94-3")
            {
                  DateTime Start = new DateTime(2015, 07, 01);
                 DateTime End = new DateTime(2015, 09, 22);
                DT1 = spDAO.GetTotalTime(Stcode, Start, End, tterm);
            }
            if (tterm == "94-95-1")
            {
                DT1 = spDAO.GetTotalTime(Stcode, TermTimeStart, TermTimeEnd, tterm);
            }
            if (tterm == "94-95-2")
            {
                DT1 = spDAO.GetTotalTime(Stcode, TermTimeStart, TermTimeEnd, tterm);
            }
            //else
            //    DT1 = GetTotalTime93942(Stcode);

            //DataTable DT10 = GetStudentClassInfoByTerm(tterm,Stcode);
            DataTable DT11 = new DataTable();
            DT11.Columns.Add("LOGIN", typeof(string));
            DT11.Columns.Add("StudentName", typeof(string));
            DT11.Columns.Add("LessonName", typeof(string));
          //  DT11.Columns.Add("PersianDate", typeof(string));
            DT11.Columns.Add("SumOfTime", typeof(string));
          //  DT11.Columns.Add("PRINCIPAL_ID", typeof(string));
            DT11.Columns.Add("code", typeof(int));
            DT11.Columns.Add("TeacherName", typeof(string));
            DT11.Columns.Add("tterm", typeof(string));
            
            
            //for (int i = 0; i < DT10.Rows.Count; i++)
            //{
                for (int j = 0; j < DT1.Rows.Count; j++)
                {
                    //if (DT10.Rows[i]["Code"].ToString() == DT1.Rows[j]["code"].ToString())
                    //{
                    DataTable dtClassInfo = spDAO.GetClassInfoByClassCode(DT1.Rows[j]["code"].ToString(), tterm);
                    if (dtClassInfo.Rows.Count>0)
	{
		 
	
                        DataRow row = DT11.NewRow();
                        row["LOGIN"] = DT1.Rows[j]["stcode"].ToString();
                        row["StudentName"] = DT1.Rows[j]["StudentName"].ToString();

                        row["LessonName"] = dtClassInfo.Rows[0]["namedars"].ToString();
                       // row["LessonName"] = DT10.Rows[i]["namedars"].ToString();
                       // row["PersianDate"] = DT1.Rows[j]["PersianDate"].ToString();
                        row["SumOfTime"] = DT1.Rows[j]["SumOfTime"].ToString();
                       // row["PRINCIPAL_ID"] = DT1.Rows[j]["PRINCIPAL_ID"].ToString();
                        row["code"] = DT1.Rows[j]["code"].ToString();
                        row["TeacherName"] = dtClassInfo.Rows[0]["Ost_Name"].ToString();
                        row["tterm"] = tterm.ToString();
                        DT11.Rows.Add(row);
                    //}
               // }
            }
}


            if (DT11.Rows.Count > 0)
            {
                DataView dv = DT11.DefaultView;
                dv.Sort = "code";
                DataTable sortedDT = dv.ToTable();

                DataTable DT3 = new DataTable();
                DT3.Columns.Add("ClassCode", typeof(string));
                DT3.Columns.Add("LessonName", typeof(string));
                DT3.Columns.Add("TeacherName", typeof(string));
                DT3.Columns.Add("SumOfTime", typeof(string));
                DT3.Columns.Add("Stcode", typeof(string));
                DT3.Columns.Add("StName", typeof(string));
                DT3.Columns.Add("tterm", typeof(string));

                TimeOfEachClass TimeOfEachClass_ = new TimeOfEachClass();
                string Code = "";
                long TotalTime = 0;

                for (int i = 0; i <= sortedDT.Rows.Count; i++)
                {
                    if (i == sortedDT.Rows.Count)
                    {
                        DataRow row = DT3.NewRow();
                        row["ClassCode"] = TimeOfEachClass_.code;
                        row["LessonName"] = TimeOfEachClass_.LessonName;
                        row["TeacherName"] = TimeOfEachClass_.TeacherName;
                        row["Stcode"] = TimeOfEachClass_.Stcode;
                        row["StName"] = TimeOfEachClass_.StName;
                        row["SumOfTime"] = TotalTime.ToString();
                        row["tterm"] = tterm.ToString();

                        DT3.Rows.Add(row);
                        TotalTime = 0;
                    }
                    else if (Code != sortedDT.Rows[i]["code"].ToString())
                    {
                        if (i > 0)
                        {
                            DataRow row = DT3.NewRow();
                            row["ClassCode"] = TimeOfEachClass_.code;
                            row["LessonName"] = TimeOfEachClass_.LessonName;
                            row["TeacherName"] = TimeOfEachClass_.TeacherName;
                            row["Stcode"] = TimeOfEachClass_.Stcode;
                            row["StName"] = TimeOfEachClass_.StName;
                            row["SumOfTime"] = TotalTime.ToString();
                            row["tterm"] = tterm.ToString();
                            DT3.Rows.Add(row);
                            TotalTime = 0;
                        }

                        TimeOfEachClass_.code = sortedDT.Rows[i]["code"].ToString();
                        TimeOfEachClass_.LessonName = sortedDT.Rows[i]["LessonName"].ToString();
                        TimeOfEachClass_.TeacherName = sortedDT.Rows[i]["TeacherName"].ToString();
                        TimeOfEachClass_.Stcode = sortedDT.Rows[i]["LOGIN"].ToString();
                        TimeOfEachClass_.StName = sortedDT.Rows[i]["StudentName"].ToString();
                        TotalTime = TotalTime + int.Parse(sortedDT.Rows[i]["SumOfTime"].ToString());
                        TimeOfEachClass_.tterm = tterm.ToString();

                        Code = TimeOfEachClass_.code;
                    }
                    else
                        TotalTime = TotalTime + int.Parse(sortedDT.Rows[i]["SumOfTime"].ToString());
                }

                return DT3;
            }
            else
                return DT1;            
            
        }
Ejemplo n.º 30
0
        public DataTable GetClassTimeResult(string ClassCode, DateTime TermTimeStart, DateTime TermTimeEnd, string tterm)
        {
            // اگر دانشجو در یک روز چند زمان داشته باشد
            // همه زمان ها را با هم جمع کرده و درآخر یکی می کند
            DataTable DT1 = new DataTable();
            DataTable DT2 = new DataTable();

            if (tterm == "93-94-1")
            {
                DT1 = GetClassTime_Old(ClassCode, TermTimeStart, TermTimeEnd);
                DT2 = GetClassTime( ClassCode, TermTimeStart, TermTimeEnd);

                foreach (DataRow item in DT2.Rows)
                    DT1.Rows.Add(item.ItemArray);
            }
            else
                DT1 = GetClassTime93942(ClassCode);

            DataTable DT10 = GetStudentClassInfo(ClassCode,tterm);
            DataTable DT11 = new DataTable();
            DT11.Columns.Add("LOGIN", typeof(string));
            DT11.Columns.Add("StudentName", typeof(string));
            DT11.Columns.Add("LessonName", typeof(string));
            DT11.Columns.Add("PersianDate", typeof(string));
            DT11.Columns.Add("SumOfTime", typeof(string));
            DT11.Columns.Add("SCO_ID", typeof(string));
            DT11.Columns.Add("PRINCIPAL_ID", typeof(string));
            DT11.Columns.Add("TeacherName", typeof(string));
            DT11.Columns.Add("code", typeof(int));
            
            DT11.Columns.Add("TimeStart", typeof(string));
            DT11.Columns.Add("TimeEND", typeof(string));
            DT11.Columns.Add("TimeClass", typeof(string));

            for (int i = 0; i < DT10.Rows.Count; i++)
            {
                for (int j = 0; j < DT1.Rows.Count; j++)
                {
                    if (DT10.Rows[i]["Code"].ToString() == DT1.Rows[j]["Code"].ToString())
                    {
                        DataRow row = DT11.NewRow();
                        row["LOGIN"] = DT1.Rows[j]["LOGIN"].ToString();
                        row["StudentName"] = DT1.Rows[j]["StudentName"].ToString();
                        row["LessonName"] = DT10.Rows[i]["namedars"].ToString();
                        row["PersianDate"] = DT1.Rows[j]["PersianDate"].ToString();
                        row["SumOfTime"] = DT1.Rows[j]["SumOfTime"].ToString();
                        row["SCO_ID"] = DT1.Rows[j]["SCO_ID"].ToString();
                        row["PRINCIPAL_ID"] = DT1.Rows[j]["PRINCIPAL_ID"].ToString();
                        row["TeacherName"] = DT1.Rows[j]["TeacherName"].ToString();
                        row["code"] = DT10.Rows[i]["did"].ToString();
                        
                        row["TimeStart"] = DT10.Rows[i]["saatstart"].ToString();
                        row["TimeEND"] = DT10.Rows[i]["saatend"].ToString();
                        row["TimeClass"] = DT10.Rows[i]["TimeClass"].ToString();

                        DT11.Rows.Add(row);

                    }
                }
            }
            

            if (DT11.Rows.Count > 0)
            {
                DataView dv = DT11.DefaultView;
                dv.Sort = "PersianDate";
                dv.Sort = "LOGIN";                
                DataTable sortedDT = dv.ToTable();

                DataTable DT3 = new DataTable();
                DT3.Columns.Add("LOGIN", typeof(string));
                DT3.Columns.Add("StudentName", typeof(string));
                DT3.Columns.Add("LessonName", typeof(string));
                DT3.Columns.Add("PersianDate", typeof(string));
                DT3.Columns.Add("SumOfTime", typeof(string));
                DT3.Columns.Add("SCO_ID", typeof(string));
                DT3.Columns.Add("PRINCIPAL_ID", typeof(string));
                DT3.Columns.Add("TeacherName", typeof(string));
                DT3.Columns.Add("code", typeof(int));
                DT3.Columns.Add("TimeStart", typeof(string));
                DT3.Columns.Add("TimeEND", typeof(string));
                DT3.Columns.Add("TimeClass", typeof(string));

                TimeOfEachClass TimeOfEachClass_ = new TimeOfEachClass();
                for (int i = 0; i  < sortedDT.Rows.Count; i++)
                {
                    if( i==0)
                    {
                        // First Row - ADD To Class
                        TimeOfEachClass_.LOGIN = sortedDT.Rows[i]["LOGIN"].ToString(); 
                        TimeOfEachClass_.StudentName = sortedDT.Rows[i]["StudentName"].ToString(); 
                        TimeOfEachClass_.LessonName = sortedDT.Rows[i]["LessonName"].ToString(); 
                        TimeOfEachClass_.PersianDate = sortedDT.Rows[i]["PersianDate"].ToString(); 
                        TimeOfEachClass_.SCO_ID = sortedDT.Rows[i]["SCO_ID"].ToString(); 
                        TimeOfEachClass_.PRINCIPAL_ID = sortedDT.Rows[i]["PRINCIPAL_ID"].ToString(); 
                        TimeOfEachClass_.TeacherName = sortedDT.Rows[i]["TeacherName"].ToString(); 
                        TimeOfEachClass_.code = sortedDT.Rows[i]["code"].ToString(); 
                        TimeOfEachClass_.TimeStart = sortedDT.Rows[i]["TimeStart"].ToString(); 
                        TimeOfEachClass_.TimeEND = sortedDT.Rows[i]["TimeEND"].ToString(); ;
                        TimeOfEachClass_.TimeClass = int.Parse(sortedDT.Rows[i]["TimeClass"].ToString());
                        TimeOfEachClass_.SumOfTime = int.Parse(sortedDT.Rows[i]["SumOfTime"].ToString()); 
                    }
                    else if (i==sortedDT.Rows.Count-1)
                    {
                        //Last Row
                        if (sortedDT.Rows[i]["LOGIN"].ToString() == sortedDT.Rows[i - 1]["LOGIN"].ToString()
                        && sortedDT.Rows[i]["PersianDate"].ToString() == sortedDT.Rows[i - 1]["PersianDate"].ToString())
                        {
                            // اگر باقبلی یکی بود
                            // مجموع ساعت حضور
                            // DataTable سپس اضافه شود به 
                            TimeOfEachClass_.SumOfTime = TimeOfEachClass_.SumOfTime + int.Parse(sortedDT.Rows[i]["SumOfTime"].ToString());

                            DataRow row = DT3.NewRow();
                            row["LOGIN"] = TimeOfEachClass_.LOGIN;
                            row["StudentName"] = TimeOfEachClass_.StudentName;
                            row["LessonName"] = TimeOfEachClass_.LessonName;
                            row["PersianDate"] = TimeOfEachClass_.PersianDate;
                            row["SCO_ID"] = TimeOfEachClass_.SCO_ID;
                            row["PRINCIPAL_ID"] = TimeOfEachClass_.PRINCIPAL_ID;
                            row["TeacherName"] = TimeOfEachClass_.TeacherName;
                            row["code"] = TimeOfEachClass_.code;
                            row["TimeStart"] = TimeOfEachClass_.TimeStart;
                            row["TimeEND"] = TimeOfEachClass_.TimeEND;
                            row["TimeClass"] = TimeOfEachClass_.TimeClass;
                            row["SumOfTime"] = TimeOfEachClass_.SumOfTime;
                            DT3.Rows.Add(row);
                        }
                        else
                        {
                            // اگر باقبلی یکی نبود
                            // ابتدا تابع قبلی اضافه شود                            
                            DataRow row = DT3.NewRow();
                            row["LOGIN"] = TimeOfEachClass_.LOGIN;
                            row["StudentName"] = TimeOfEachClass_.StudentName;
                            row["LessonName"] = TimeOfEachClass_.LessonName;
                            row["PersianDate"] = TimeOfEachClass_.PersianDate;
                            row["SCO_ID"] = TimeOfEachClass_.SCO_ID;
                            row["PRINCIPAL_ID"] = TimeOfEachClass_.PRINCIPAL_ID;
                            row["TeacherName"] = TimeOfEachClass_.TeacherName;
                            row["code"] = TimeOfEachClass_.code;
                            row["TimeStart"] = TimeOfEachClass_.TimeStart;
                            row["TimeEND"] = TimeOfEachClass_.TimeEND;
                            row["TimeClass"] = TimeOfEachClass_.TimeClass;
                            row["SumOfTime"] = TimeOfEachClass_.SumOfTime;
                            DT3.Rows.Add(row);

                            // سپس آخرین ردیف اضافه شود
                            DataRow row1 = DT3.NewRow();
                            row1["LOGIN"] = sortedDT.Rows[i]["LOGIN"].ToString();
                            row1["StudentName"] = sortedDT.Rows[i]["StudentName"].ToString();
                            row1["LessonName"] = sortedDT.Rows[i]["LessonName"].ToString();
                            row1["PersianDate"] = sortedDT.Rows[i]["PersianDate"].ToString();
                            row1["SCO_ID"] = sortedDT.Rows[i]["SCO_ID"].ToString();
                            row1["PRINCIPAL_ID"] = sortedDT.Rows[i]["PRINCIPAL_ID"].ToString();
                            row1["TeacherName"] = sortedDT.Rows[i]["TeacherName"].ToString();
                            row1["code"] = sortedDT.Rows[i]["code"].ToString();
                            row1["TimeStart"] = sortedDT.Rows[i]["TimeStart"].ToString();
                            row1["TimeEND"] = sortedDT.Rows[i]["TimeEND"].ToString();
                            row1["TimeClass"] = sortedDT.Rows[i]["TimeClass"].ToString();
                            row1["SumOfTime"] = sortedDT.Rows[i]["SumOfTime"].ToString();
                            DT3.Rows.Add(row1);                  
                        }
                    }
                    else if (sortedDT.Rows[i]["LOGIN"].ToString() == sortedDT.Rows[i - 1]["LOGIN"].ToString()
                        && sortedDT.Rows[i]["PersianDate"].ToString() == sortedDT.Rows[i - 1]["PersianDate"].ToString())
                    {
                        // اگر باقبلی یکی نبود
                        TimeOfEachClass_.SumOfTime = TimeOfEachClass_.SumOfTime + int.Parse(sortedDT.Rows[i]["SumOfTime"].ToString());
                    }                    
                    else
                    {
                        //   اضافه شود  DataTable ابتدا ردیف قبل به 
                        DataRow row = DT3.NewRow();
                        row["LOGIN"] = TimeOfEachClass_.LOGIN;
                        row["StudentName"] = TimeOfEachClass_.StudentName;
                        row["LessonName"] = TimeOfEachClass_.LessonName;
                        row["PersianDate"] = TimeOfEachClass_.PersianDate;
                        row["SCO_ID"] = TimeOfEachClass_.SCO_ID;
                        row["PRINCIPAL_ID"] = TimeOfEachClass_.PRINCIPAL_ID;
                        row["TeacherName"] = TimeOfEachClass_.TeacherName;
                        row["code"] = TimeOfEachClass_.code;
                        row["TimeStart"] = TimeOfEachClass_.TimeStart;
                        row["TimeEND"] = TimeOfEachClass_.TimeEND;
                        row["TimeClass"] = TimeOfEachClass_.TimeClass;
                        row["SumOfTime"] = TimeOfEachClass_.SumOfTime;
                        DT3.Rows.Add(row);

                        // سپس ردیف جدید در کلاس قرار گیرد 
                        TimeOfEachClass_.LOGIN = sortedDT.Rows[i]["LOGIN"].ToString();
                        TimeOfEachClass_.StudentName = sortedDT.Rows[i]["StudentName"].ToString();
                        TimeOfEachClass_.LessonName = sortedDT.Rows[i]["LessonName"].ToString();
                        TimeOfEachClass_.PersianDate = sortedDT.Rows[i]["PersianDate"].ToString();
                        TimeOfEachClass_.SCO_ID = sortedDT.Rows[i]["SCO_ID"].ToString();
                        TimeOfEachClass_.PRINCIPAL_ID = sortedDT.Rows[i]["PRINCIPAL_ID"].ToString();
                        TimeOfEachClass_.TeacherName = sortedDT.Rows[i]["TeacherName"].ToString();
                        TimeOfEachClass_.code = sortedDT.Rows[i]["code"].ToString();
                        TimeOfEachClass_.TimeStart = sortedDT.Rows[i]["TimeStart"].ToString();
                        TimeOfEachClass_.TimeEND = sortedDT.Rows[i]["TimeEND"].ToString(); ;
                        TimeOfEachClass_.TimeClass = int.Parse(sortedDT.Rows[i]["TimeClass"].ToString());
                        TimeOfEachClass_.SumOfTime = int.Parse(sortedDT.Rows[i]["SumOfTime"].ToString()); 
                    }

                }
                

                // Final Sort
                DataView dv2 = DT3.DefaultView;
                dv2.Sort = "PersianDate";          
                DataTable sortedDT2 = dv2.ToTable();
                
                return sortedDT2;
            }
            else
                return DT1;    

            
        }
Ejemplo n.º 31
0
        public DataTable TimeResult(string StudentCode, string ClassCode, DateTime TermTimeStart, DateTime TermTimeEnd,string tterm)
        {
            DataTable DT1=new DataTable();
            DataTable DT2 = new DataTable();

            if (tterm == "93-94-1")
            {
                DT1 = GetTime_Old(StudentCode, ClassCode, TermTimeStart, TermTimeEnd);
                DT2 = GetTime(StudentCode, ClassCode, TermTimeStart, TermTimeEnd);

                foreach (DataRow item in DT2.Rows)
                    DT1.Rows.Add(item.ItemArray);
            }
            if (tterm == "93-94-2")
            {
                DateTime Start = new DateTime(2015, 02, 01);
                DateTime End = new DateTime(2015, 08, 22);
                DT1 = spDAO.GetStudentTimeMeetingByClassCode(StudentCode, ClassCode, Start, End, "Live");
            }
            if (tterm == "93-94-3")
            {
                DateTime Start = new DateTime(2015, 07, 01);
                DateTime End = new DateTime(2015, 09, 22);
                DT1 = spDAO.GetStudentTimeMeetingByClassCode(StudentCode, ClassCode, Start, End, "Live"); 
            }
            if (tterm == "94-95-1")
            {
                DateTime Start = new DateTime(2015, 09, 12);
                DateTime End = new DateTime(2016, 01, 22);
                DT1 = spDAO.GetStudentTimeMeetingByClassCode(StudentCode, ClassCode, Start, End, "Class");
            }
            if (tterm == "94-95-2")
            {
                DateTime Start = new DateTime(2016, 02, 06);
                DateTime End = new DateTime(2016, 06, 22);
                DT1 = spDAO.GetStudentTimeMeetingByClassCode(StudentCode, ClassCode, Start, End, "vc_new");
            }

           // DataTable DT10 = spDAO.GetStudentClassInfo(ClassCode,tterm);
            DataTable DT11 = new DataTable();
            DT11.Columns.Add("LOGIN", typeof(string));
            DT11.Columns.Add("StudentName", typeof(string));
            DT11.Columns.Add("LessonName", typeof(string));
            DT11.Columns.Add("PersianDate", typeof(string));
            DT11.Columns.Add("SumOfTime", typeof(string));
            DT11.Columns.Add("SCO_ID", typeof(string));
            DT11.Columns.Add("PRINCIPAL_ID", typeof(string));
            DT11.Columns.Add("code", typeof(int));
            DT11.Columns.Add("TeacherName", typeof(string));
            DT11.Columns.Add("TimeStart", typeof(string));
            DT11.Columns.Add("TimeEND", typeof(string));
            DT11.Columns.Add("TimeClass", typeof(string));

            //for (int i = 0; i < DT10.Rows.Count; i++)
            //{
                for (int j = 0; j < DT1.Rows.Count; j++)
                {
                    DataTable dtClassInfo = spDAO.GetClassInfoByClassCode(DT1.Rows[j]["code"].ToString(), tterm);
                    if (dtClassInfo.Rows.Count > 0)
                    {
                   
                        DataRow row = DT11.NewRow();
                        row["LOGIN"] = DT1.Rows[j]["LOGIN"].ToString();
                        row["StudentName"] = DT1.Rows[j]["StudentName"].ToString();
                        row["LessonName"] = dtClassInfo.Rows[0]["namedars"].ToString();
                        row["PersianDate"] = DT1.Rows[j]["PersianDate"].ToString();
                        row["SumOfTime"] = DT1.Rows[j]["SumOfTime"].ToString();
                        row["SCO_ID"] = DT1.Rows[j]["SCO_ID"].ToString();
                        row["PRINCIPAL_ID"] = DT1.Rows[j]["PRINCIPAL_ID"].ToString();
                        row["code"] = DT1.Rows[j]["code"].ToString();
                        row["TeacherName"] = DT1.Rows[j]["TeacherName"].ToString();
                        //row["TimeStart"] = dtClassInfo.Rows[0]["saatstart"].ToString();
                        //row["TimeEND"] = dtClassInfo.Rows[0]["saatend"].ToString();
                        row["TimeClass"] = dtClassInfo.Rows[0]["Klas_DAy"].ToString() + " " + dtClassInfo.Rows[0]["ClassTime"].ToString();

                        DT11.Rows.Add(row);

                    }
                }
            
            return DT11;
        }
Ejemplo n.º 32
0
 private void LOAD_DATA_EXCEL()
 {
     try
     {
         OleDbConnection  cnnxls  = new OleDbConnection(strConn);
         OleDbCommand     comando = new OleDbCommand("select * from [" + TXT_NOMBRE_HOJA.Text.Trim() + "$]", cnnxls);
         OleDbDataAdapter adapter = new OleDbDataAdapter(comando);
         adapter.Fill(tbContainer);
         DataRow dr = tbContainer.Rows[0];
         dr.Delete();
         tbContainer.AcceptChanges();
         if (!RA_PACKING.Checked)
         {
             tbContainer.Columns.Add("Fila", typeof(System.Int32));
             for (int i = 0; i <= tbContainer.Rows.Count - 1; i++)
             {
                 tbContainer.Rows[i]["Fila"] = i + 2;
             }
         }
         else
         {
             DataRow dr1 = tbContainer.Rows[0];
             dr1.Delete();
             tbContainer.AcceptChanges();
         }
         dv = tbContainer.DefaultView;
         GRID_IMPORT.DataSource = dv;
         if (RA_MASTERS.Checked)
         {
             LOADATA_MASTERS();
             ValidarData = true;
         }
         if (RA_CORTADOS.Checked)
         {
             LOADATA_CORTADOS();
         }
         if (RA_HOJAS.Checked)
         {
             LOADATA_HOJAS();
             //no tiene depuracion de data.
             BOT_DEBUG_DATA.Enabled = false;
         }
         if (RA_GRAPHICS.Checked)
         {
             LOADATA_GRAPHICS();
         }
         if (RA_PACKING.Checked)
         {
             LOADATA_PACKING();
         }
         if (!RA_PACKING.Checked)
         {
             GRID_IMPORT.Columns["Fila"].DisplayIndex = 0;
         }
         TXT_ROWS.Text = (tbContainer.Rows.Count).ToString();
         // si la busqueda es por rollo cortado
     }
     catch (Exception)
     {
         MessageBox.Show("Error!");
     }
 }
Ejemplo n.º 33
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Jium.Model.consumer DataRowToModel(DataRow row)
 {
     Jium.Model.consumer model = new Jium.Model.consumer();
     if (row != null)
     {
         if (row["id"] != null && row["id"].ToString() != "")
         {
             model.id = int.Parse(row["id"].ToString());
         }
         if (row["cname"] != null)
         {
             model.cname = row["cname"].ToString();
         }
         if (row["ccode"] != null)
         {
             model.ccode = row["ccode"].ToString();
         }
         if (row["cphone"] != null)
         {
             model.cphone = row["cphone"].ToString();
         }
         if (row["cemail"] != null)
         {
             model.cemail = row["cemail"].ToString();
         }
         if (row["clevel"] != null)
         {
             model.clevel = row["clevel"].ToString();
         }
         if (row["csum"] != null && row["csum"].ToString() != "")
         {
             model.csum = decimal.Parse(row["csum"].ToString());
         }
         if (row["csex"] != null && row["csex"].ToString() != "")
         {
             model.csex = int.Parse(row["csex"].ToString());
         }
         if (row["cremark"] != null)
         {
             model.cremark = row["cremark"].ToString();
         }
         if (row["css1"] != null)
         {
             model.css1 = row["css1"].ToString();
         }
         if (row["css2"] != null)
         {
             model.css2 = row["css2"].ToString();
         }
         if (row["css3"] != null)
         {
             model.css3 = row["css3"].ToString();
         }
         if (row["css4"] != null)
         {
             model.css4 = row["css4"].ToString();
         }
         if (row["css5"] != null)
         {
             model.css5 = row["css5"].ToString();
         }
         if (row["csd1"] != null && row["csd1"].ToString() != "")
         {
             model.csd1 = int.Parse(row["csd1"].ToString());
         }
         if (row["csd2"] != null && row["csd2"].ToString() != "")
         {
             model.csd2 = int.Parse(row["csd2"].ToString());
         }
         if (row["csd3"] != null && row["csd3"].ToString() != "")
         {
             model.csd3 = int.Parse(row["csd3"].ToString());
         }
         if (row["csd4"] != null && row["csd4"].ToString() != "")
         {
             model.csd4 = int.Parse(row["csd4"].ToString());
         }
         if (row["csd5"] != null && row["csd5"].ToString() != "")
         {
             model.csd5 = int.Parse(row["csd5"].ToString());
         }
         if (row["csdc1"] != null && row["csdc1"].ToString() != "")
         {
             model.csdc1 = decimal.Parse(row["csdc1"].ToString());
         }
         if (row["csdc2"] != null && row["csdc2"].ToString() != "")
         {
             model.csdc2 = decimal.Parse(row["csdc2"].ToString());
         }
         if (row["csdc3"] != null && row["csdc3"].ToString() != "")
         {
             model.csdc3 = decimal.Parse(row["csdc3"].ToString());
         }
         if (row["csdc4"] != null && row["csdc4"].ToString() != "")
         {
             model.csdc4 = decimal.Parse(row["csdc4"].ToString());
         }
         if (row["csdc5"] != null && row["csdc5"].ToString() != "")
         {
             model.csdc5 = decimal.Parse(row["csdc5"].ToString());
         }
     }
     return(model);
 }
        private void getDate(string sSQLWH)         //加载数据
        {
            string sSQL = string.Empty;

            sSQL += "  SELECT  b1.FName FClassName,b2.FShortName FBoatName,FRunTimeByDay=CAST( FRunTimeByHour/8 as decimal(18,4)), ";

            sSQL += " FStateDesc=CASE WHEN FState='0' THEN '未审核' WHEN FState='1' THEN '已审核'  ELSE '已确认' END, ";
            sSQL += "  t.* FROM TAB08 t ";
            sSQL += " INNER JOIN YZ_BaseEntry b1 ON t.FClassID=b1.FID AND b1.FUID=1 ";
            sSQL += " INNER JOIN YZ_BaseEntry b2 ON t.FBoatID=b2.FID AND b2.FUID=2 ";
            sSQL += " where 1>0 ";
            if (sSQLWH != string.Empty)
            {
                sSQL += sSQLWH;                 //查询条件
            }
            sSQL += " ORDER BY FDate";

            DataTable dttSQL = k3db.GetDataTable(sSQL, "A");

            bdsMaster.DataSource = dttSQL;

            sSQL = string.Empty;

            sSQL += " SELECT FDate,  b2.FShortName FBoatName,FRunTimeByDay=CAST( SUM(FRunTimeByHour)/24 as decimal(18,4)),  ";
            sSQL += " SUM(FRunTimeByHour) FRunTimeByHour,  ";
            sSQL += " SUM(FDownTimeByHour) FDownTimeByHour,  ";
            sSQL += " SUM(FAmountOfFinish) FAmountOfFinish,  ";

            //sSQL += " sum(FZC_CJ)/3 FZC_CJ, ";
            //sSQL += " sum(FZC_GL)/3 FZC_GL, ";
            //sSQL += " sum(FZC_TC)/3 FZC_TC, ";
            //sSQL += " sum(FZC_YK)/3 FZC_YK, ";
            //sSQL += " sum(FZC_PK)/3 FZC_PK, ";

            sSQL += " cast((sum(FZC_CJ)/COUNT(*)) as decimal(18,2)) FZC_CJ, ";
            sSQL += " cast((sum(FZC_GL)/COUNT(*))  as decimal(18,2)) FZC_GL, ";
            sSQL += " cast((sum(FZC_TC)/COUNT(*))  as decimal(18,2)) FZC_TC, ";
            sSQL += " cast((sum(FZC_YK)/COUNT(*))  as decimal(18,2)) FZC_YK, ";
            sSQL += " cast((sum(FZC_PK)/COUNT(*))  as decimal(18,2)) FZC_PK, ";

            sSQL += " sum(FGZ_CJ) FGZ_CJ, ";
            sSQL += " sum(FGZ_GL) FGZ_GL, ";
            sSQL += " sum(FGZ_TC) FGZ_TC, ";
            sSQL += " sum(FGZ_YK) FGZ_YK, ";
            sSQL += " sum(FGZ_PK) FGZ_PK, ";
            sSQL += " sum(FGZ_SW) FGZ_SW, ";
            sSQL += " sum(FGZ_PD) FGZ_PD, ";
            sSQL += " sum(FGZ_JX) FGZ_JX, ";
            sSQL += " sum(FGZ_QT) FGZ_QT, ";

            sSQL += " sum(FSB_CJ) FSB_CJ, ";
            sSQL += " sum(FSB_GL) FSB_GL, ";
            sSQL += " sum(FSB_TC) FSB_TC, ";
            sSQL += " sum(FSB_YK) FSB_YK, ";
            sSQL += " sum(FSB_PK) FSB_PK, ";
            sSQL += " sum(FSB_SW) FSB_SW, ";
            sSQL += " sum(FSB_PD) FSB_PD, ";
            sSQL += " sum(FSB_JX) FSB_JX, ";
            sSQL += " sum(FSB_QT) FSB_QT, ";

            sSQL += " SUM(FEmployeeNum) FEmployeeNum  ";

            sSQL += " FROM TAB08 t  ";
            sSQL += " INNER JOIN YZ_BaseEntry b2 ON t.FBoatID=b2.FID AND b2.FUID=2  ";
            sSQL += " Where 1>0 ";
            if (sSQLWH2 != string.Empty)
            {
                sSQL += sSQLWH2;                 //查询条件
            }
            sSQL += " GROUP BY FDate,b2.FShortName  ";
            sSQL += " ORDER BY FDate  ";
            DataTable dttSQL2 = k3db.GetDataTable(sSQL, "A");


            //计算合计行
            DataRow dtr = dttSQL2.NewRow();

            dtr["FDate"]           = "合计";
            dtr["FRunTimeByDay"]   = dttSQL2.Compute("Sum(FRunTimeByDay)", "");
            dtr["FRunTimeByHour"]  = dttSQL2.Compute("Sum(FRunTimeByHour)", "");
            dtr["FDownTimeByHour"] = dttSQL2.Compute("Sum(FDownTimeByHour)", "");
            dtr["FAmountOfFinish"] = dttSQL2.Compute("Sum(FAmountOfFinish)", "");

            dtr["FZC_CJ"] = dttSQL2.Compute("Sum(FZC_CJ)", "");
            dtr["FZC_GL"] = dttSQL2.Compute("Sum(FZC_GL)", "");
            dtr["FZC_TC"] = dttSQL2.Compute("Sum(FZC_TC)", "");
            dtr["FZC_YK"] = dttSQL2.Compute("Sum(FZC_YK)", "");
            dtr["FZC_PK"] = dttSQL2.Compute("Sum(FZC_PK)", "");

            dtr["FGZ_CJ"] = dttSQL2.Compute("Sum(FGZ_CJ)", "");
            dtr["FGZ_GL"] = dttSQL2.Compute("Sum(FGZ_GL)", "");
            dtr["FGZ_TC"] = dttSQL2.Compute("Sum(FGZ_TC)", "");
            dtr["FGZ_YK"] = dttSQL2.Compute("Sum(FGZ_YK)", "");
            dtr["FGZ_PK"] = dttSQL2.Compute("Sum(FGZ_PK)", "");
            dtr["FGZ_SW"] = dttSQL2.Compute("Sum(FGZ_SW)", "");
            dtr["FGZ_PD"] = dttSQL2.Compute("Sum(FGZ_PD)", "");
            dtr["FGZ_JX"] = dttSQL2.Compute("Sum(FGZ_JX)", "");
            dtr["FGZ_QT"] = dttSQL2.Compute("Sum(FGZ_QT)", "");

            dtr["FSB_CJ"] = dttSQL2.Compute("Sum(FSB_CJ)", "");
            dtr["FSB_GL"] = dttSQL2.Compute("Sum(FSB_GL)", "");
            dtr["FSB_TC"] = dttSQL2.Compute("Sum(FSB_TC)", "");
            dtr["FSB_YK"] = dttSQL2.Compute("Sum(FSB_YK)", "");
            dtr["FSB_PK"] = dttSQL2.Compute("Sum(FSB_PK)", "");
            dtr["FSB_SW"] = dttSQL2.Compute("Sum(FSB_SW)", "");
            dtr["FSB_PD"] = dttSQL2.Compute("Sum(FSB_PD)", "");
            dtr["FSB_JX"] = dttSQL2.Compute("Sum(FSB_JX)", "");
            dtr["FSB_QT"] = dttSQL2.Compute("Sum(FSB_QT)", "");


            dtr["FEmployeeNum"] = dttSQL2.Compute("Sum(FEmployeeNum)", "");

            dttSQL2.Rows.Add(dtr);


            bdsMaster2.DataSource = dttSQL2;
        }
Ejemplo n.º 35
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oDesign           = new Design(intProfile, dsn);
            oPage             = new Pages(intProfile, dsn);
            oMnemonic         = new Mnemonic(intProfile, dsn);
            oCostCenter       = new CostCenter(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oEnvironment      = new Environments(intProfile, dsn);
            oLocation         = new Locations(intProfile, dsn);
            oOperatingSystem  = new OperatingSystems(intProfile, dsn);
            oHoliday          = new Holidays(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oUser             = new Users(intProfile, dsn);
            oFunction         = new Functions(intProfile, dsn, intEnvironment);
            oForecast         = new Forecast(intProfile, dsn);
            oRequest          = new Requests(intProfile, dsn);
            oProject          = new Projects(intProfile, dsn);

            //if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            //intID = Int32.Parse(Request.QueryString["id"]);
            if (!IsPostBack)
            {
                DataSet dsSummary = oDesign.Get(this.DesignId);
                if (dsSummary.Tables[0].Rows.Count > 0)
                {
                    int intModel = oDesign.GetModelProperty(this.DesignId);
                    lblSummarySolution.Text = oModelsProperties.Get(intModel, "name");

                    DataRow drSummary   = dsSummary.Tables[0].Rows[0];
                    bool    boolWeb     = (drSummary["web"].ToString() == "1");
                    bool    boolSQL     = oDesign.IsSQL(this.DesignId);
                    bool    boolOracle  = oDesign.IsOracle(this.DesignId);
                    bool    boolOtherDB = (drSummary["other_db"].ToString() == "1");

                    DataSet dsSubmitted = oDesign.GetSubmitted(this.DesignId);
                    if (dsSubmitted.Tables[0].Rows.Count > 0)
                    {
                        trSubmitted.Visible = true;
                        int intUser = Int32.Parse(dsSubmitted.Tables[0].Rows[0]["userid"].ToString());
                        lblSummarySubmittedBy.Text = oUser.GetFullName(intUser) + " (" + oUser.GetName(intUser) + ")";
                        lblSummarySubmittedOn.Text = dsSubmitted.Tables[0].Rows[0]["created"].ToString();
                        if (dsSubmitted.Tables[0].Rows[0]["comments"].ToString() != "")
                        {
                            trException1.Visible = true;
                            trException2.Visible = true;
                            trException3.Visible = true;
                            lblException.Text    = oFunction.FormatText(dsSubmitted.Tables[0].Rows[0]["comments"].ToString());
                            lblExceptionID.Text  = dsSubmitted.Tables[0].Rows[0]["exceptionID"].ToString();
                        }
                    }

                    // Project
                    int intForecast = 0;
                    int intRequest  = 0;
                    int intProject  = 0;
                    Int32.TryParse(drSummary["forecastid"].ToString(), out intForecast);
                    if (intForecast > 0)
                    {
                        Int32.TryParse(oForecast.Get(intForecast, "requestid"), out intRequest);
                        if (intRequest > 0)
                        {
                            intProject = oRequest.GetProjectNumber(intRequest);
                            if (intProject > 0)
                            {
                                lblSummaryProjectName.Text = oProject.Get(intProject, "name");
                                string strNumber = oProject.Get(intProject, "number");
                                lblSummaryProjectNumber.Text = strNumber;
                                // Check to see if Demo
                                DataSet dsDemo = oFunction.GetSetupValuesByKey("DEMO_PROJECT");
                                foreach (DataRow drDemo in dsDemo.Tables[0].Rows)
                                {
                                    if (strNumber == drDemo["Value"].ToString())
                                    {
                                        boolDemo = true;
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    // Mnemonic
                    int intMnemonic = 0;
                    Int32.TryParse(drSummary["mnemonicid"].ToString(), out intMnemonic);
                    if (intMnemonic > 0)
                    {
                        lblSummaryMnemonic.Text = oMnemonic.Get(intMnemonic, "factory_code") + " - " + oMnemonic.Get(intMnemonic, "name");
                    }
                    // Class + Environment + Location
                    int intClass   = 0;
                    int intEnv     = 0;
                    int intAddress = 0;
                    Int32.TryParse(drSummary["classid"].ToString(), out intClass);
                    if (intClass > 0)
                    {
                        lblSummaryLocation.Text = oClass.Get(intClass, "name") + ", ";
                        Int32.TryParse(drSummary["environmentid"].ToString(), out intEnv);
                        if (intEnv > 0)
                        {
                            lblSummaryLocation.Text += oEnvironment.Get(intEnv, "name");
                            Int32.TryParse(drSummary["addressid"].ToString(), out intAddress);
                            if (intAddress > 0)
                            {
                                lblSummaryLocation.Text += " at <a href=\"javascript:void(0);\" onclick=\"ShowHideDiv2('divLocation');\">" + oLocation.GetFull(intAddress) + " <img src=\"/images/help.gif\" border=\"0\" align=\"absmiddle\"/></a>";
                            }
                            else
                            {
                                bool    boolProd    = oClass.IsProd(intClass);
                                bool    boolQA      = oClass.IsQA(intClass);
                                bool    boolTest    = oClass.IsTestDev(intClass);
                                bool    boolDR      = oClass.IsDR(intClass);
                                DataSet dsLocations = oLocation.GetAddressClass((boolDR ? 1 : 0), (boolProd ? 1 : 0), (boolQA ? 1 : 0), (boolTest ? 1 : 0));
                                if (dsLocations.Tables[0].Rows.Count > 0)
                                {
                                    StringBuilder strLocation      = new StringBuilder();
                                    int           intLocationCount = 0;
                                    foreach (DataRow drLocation in dsLocations.Tables[0].Rows)
                                    {
                                        intLocationCount++;
                                        if (intLocationCount > 1)
                                        {
                                            if (intLocationCount > 2)
                                            {
                                                strLocation.Insert(0, ", ");
                                            }
                                            else
                                            {
                                                strLocation.Insert(0, " or ");
                                            }
                                        }
                                        if (drLocation["commonname"].ToString() != "")
                                        {
                                            strLocation.Insert(0, drLocation["commonname"].ToString());
                                        }
                                        else
                                        {
                                            strLocation.Insert(0, oLocation.GetFull(Int32.Parse(drLocation["id"].ToString())));
                                        }
                                    }
                                    lblSummaryLocation.Text += " at <a href=\"javascript:void(0);\" onclick=\"ShowHideDiv2('divLocation');\">" + strLocation.ToString() + " <img src=\"/images/help.gif\" border=\"0\" align=\"absmiddle\"/></a>";
                                }
                            }
                        }
                    }
                    // Server Type
                    if (oDesign.IsDatabase(this.DesignId) == false)
                    {
                        if (boolWeb)
                        {
                            lblSummaryServerType.Text = "Web";
                        }
                        else
                        {
                            lblSummaryServerType.Text = "Application";
                        }
                    }
                    else
                    {
                        lblSummaryServerType.Text = "Database";
                        if (boolSQL || boolOracle || boolOtherDB)
                        {
                            string strDatabase = "";
                            if (boolSQL == true)
                            {
                                strDatabase = "SQL";
                            }
                            if (boolOracle == true)
                            {
                                strDatabase = "Oracle";
                            }
                            if (boolOtherDB == true)
                            {
                                strDatabase = "Other";
                            }
                            lblSummaryServerType.Text += " (" + strDatabase + ")";
                        }
                        if (boolWeb)
                        {
                            lblSummaryServerType.Text += " + Web";
                        }
                    }
                    // Quantity
                    int intQuantity = 0;
                    Int32.TryParse(drSummary["quantity"].ToString(), out intQuantity);
                    if (intQuantity > 0)
                    {
                        lblSummaryQuantity.Text = intQuantity.ToString();
                    }
                    // OS
                    int intOS = 0;
                    Int32.TryParse(drSummary["osid"].ToString(), out intOS);
                    if (intOS > 0)
                    {
                        lblSummaryOS.Text = oOperatingSystem.Get(intOS, "name");
                    }
                    // SIZE
                    string strSize = drSummary["cores"].ToString() + " CPU(s), " + drSummary["ram"].ToString() + " GB(s) RAM";
                    lblSummarySize.Text = strSize;
                    // STORAGE
                    if (drSummary["storage"].ToString() == "1")
                    {
                        if (drSummary["persistent"].ToString() == "1")
                        {
                            int intPersistent = oDesign.GetStorageTotal(this.DesignId);
                            if (intPersistent > 0)
                            {
                                lblSummaryStorage.Text = "Persistent, " + intPersistent.ToString() + " GB(s)";
                            }
                        }
                        else if (drSummary["persistent"].ToString() == "0")
                        {
                            int intNonPersistent = 0;
                            Int32.TryParse(drSummary["non_persistent"].ToString(), out intNonPersistent);
                            if (intNonPersistent > 0)
                            {
                                lblSummaryStorage.Text = "Non-Persistent, " + intNonPersistent.ToString() + " GB(s)";
                            }
                        }
                        else
                        {
                            int intStorage = oDesign.GetStorageTotal(this.DesignId);
                            if (intStorage > 0)
                            {
                                lblSummaryStorage.Text = intStorage.ToString() + " GB(s)";
                            }
                        }
                    }
                    else if (drSummary["storage"].ToString() == "0")
                    {
                        lblSummaryStorage.Text = "No";
                    }
                    // HA
                    if (drSummary["ha"].ToString() == "1")
                    {
                        if (oModelsProperties.IsSUNVirtual(intModel) == true)
                        {
                            lblSummaryHA.Text = "Sun Virtual Environment (SVE)";
                        }
                        else if (drSummary["ha_clustering"].ToString() == "1")
                        {
                            lblSummaryHA.Text = "Clustered";
                            if (drSummary["active_passive"].ToString() == "1")
                            {
                                lblSummaryHA.Text += " (Active / Passive)";
                            }
                            else if (drSummary["active_passive"].ToString() == "2")
                            {
                                lblSummaryHA.Text += " (Active / Active)";
                            }
                        }
                        else if (drSummary["ha_load_balancing"].ToString() == "1")
                        {
                            lblSummaryHA.Text = "Load Balancing";
                        }
                    }
                    else if (drSummary["ha"].ToString() == "0")
                    {
                        lblSummaryHA.Text = "No";
                    }
                    else
                    {
                        lblSummaryHA.Text = "<i>N / A</i>";
                    }
                    // SPECIAL
                    if (oModelsProperties.IsVMwareVirtual(intModel))
                    {
                        lblSummaryBootType.Text = "Virtual Hard Disk (VHD)";
                    }
                    else if (oModelsProperties.IsStorageDB_BootLocal(intModel))
                    {
                        lblSummaryBootType.Text = "Local Disk";
                    }
                    else
                    {
                        lblSummaryBootType.Text = "SAN Disk";
                    }
                    // DATE
                    DateTime datDate = DateTime.Now;
                    if (DateTime.TryParse(drSummary["commitment"].ToString(), out datDate) == true)
                    {
                        lblSummaryDate.Text = datDate.ToShortDateString();
                        // Target completion date = 2 weeks later than commitment
                        DateTime datTarget = oHoliday.GetDays(dblSLA, datDate);
                        string   strTarget = datTarget.ToShortDateString();
                        if (strTarget != "")
                        {
                            lblSummaryTarget.Text = strTarget + "&nbsp;&nbsp;&nbsp;&nbsp;(<a href=\"javascript:void(0);\" onclick=\"alert('" + strTarget + " is " + dblSLA.ToString() + " business days from your build date (" + lblSummaryDate.Text + ").\\n\\nBusiness days exclude weekends and holidays.');\">How is this calculated?</a>)";
                        }
                    }
                    // CONFIDENCE
                    lblSummaryConfidence.Text = drSummary["confidence"].ToString();
                    //if (oDesign.IsOther(this.DesignId, 1, 0, 0) == true)
                    //    btnUnlock.Visible = true;
                    btnUnlock.Attributes.Add("onclick", "return OpenWindow('DESIGN_UNLOCK','" + this.DesignId.ToString() + "')");

                    /*
                     * if (drSummary["answerid"].ToString() == "")
                     *  lblSummaryAnswerID.Text = "N / A";
                     * else
                     *  lblSummaryAnswerID.Text = "<a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/datapoint/service/design.aspx?t=design&q=" + oFunction.encryptQueryString(drSummary["answerid"].ToString()) + "',800,600);\">" + drSummary["answerid"].ToString() + "</a>";
                     */

                    if (this.ExceptionServiceFolder > 0)
                    {
                        this.ExceptionRadio.Visible = false;
                    }

                    if (this.ExceptionServiceFolder > 0 && oDesign.IsOther(this.DesignId, 0, 0, 1))
                    {
                        this.ExceptionServiceFolderPanel.Visible = true;
                        this.CompleteRadio.Enabled = false;
                    }
                    else
                    {
                        string strValidation = oDesign.GetValid(this.DesignId);
                        if (strValidation != "")
                        {
                            // Invalid Design
                            if (this.InvalidPanel != null)
                            {
                                this.InvalidPanel.Style["display"] = "inline";
                            }
                            // Hide the Rejection screen (if shown)
                            if (this.RejectPanel != null)
                            {
                                this.RejectPanel.Style["display"] = "none";
                            }

                            if (this.Demo == false && this.CompleteRadio != null)
                            {
                                this.CompleteRadio.Text   += " <i>(Incomplete)</i>";
                                this.CompleteRadio.Enabled = false;
                            }
                            if (this.ValidationLabel != null)
                            {
                                string[] strValidations = strValidation.Split(new char[] { ',' });
                                foreach (string strError in strValidations)
                                {
                                    if (strError.Trim() != "")
                                    {
                                        if (this.ValidationLabel.Text != "")
                                        {
                                            this.ValidationLabel.Text += "<br/>";
                                        }
                                        this.ValidationLabel.Text += " - " + strError.Trim();
                                    }
                                }
                            }
                        }
                        else
                        {
                            btnUnlock.Visible = false;

                            // Valid Design
                            if (this.RejectPanel == null || this.RejectPanel.Style["display"] != "inline")
                            {
                                if (oDesign.IsOther(this.DesignId, 0, 0, 1) == true)
                                {
                                    if (this.ExceptionPanel != null)
                                    {
                                        this.ExceptionPanel.Style["display"] = "inline";
                                    }
                                }
                                else if (this.ValidPanel != null)
                                {
                                    this.ValidPanel.Style["display"] = "inline";
                                }
                            }
                            // Check confidence and Date
                            string strCanExecute = oDesign.CanExecute(this.DesignId);
                            if (this.Demo == true)
                            {
                                if (strCanExecute != "")
                                {
                                    this.InvalidPanel.Style["display"] = "inline";
                                }
                                if (this.ValidationLabel != null)
                                {
                                    this.ValidationLabel.Text = " - " + strCanExecute;
                                }
                            }
                            else if (this.CompleteRadio != null)
                            {
                                if (strCanExecute != "")
                                {
                                    this.CompleteRadio.Text += " <i>(" + strCanExecute + ")</i>";
                                }

                                if (this.CompleteRadio.Text.Contains("<i>"))
                                {
                                    this.CompleteRadio.Enabled = false;
                                    this.CompleteRadio.Checked = false;
                                }
                            }
                        }

                        if (this.Demo == true && InvalidPanel.Style["display"] == "inline")
                        {
                            ValidPanel.Style["display"] = "none";
                            CompleteRadio.Enabled       = false;
                            ScheduleRadio.Enabled       = false;
                        }
                    }
                }
            }
        }
Ejemplo n.º 36
0
 public OrderStatus status(DataRow row) {
     return OrderTable.orderStatus(row);
 }
Ejemplo n.º 37
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromSwsst(ref DataRow row, Swsst entity)
 {
     UpdateRowFromSwsstBase(ref row, entity);
 }
Ejemplo n.º 38
0
 /// <summary>
 /// Build a minimal row from a class (key fields only)
 /// </summary>
 public static void BuildMinimalRow(ref DataRow row, Swsst entity)
 {
     SwsstBase.BuildMinimalRow(ref row, entity);
 }
Ejemplo n.º 39
0
        /// <summary>
        /// Build a class from a database row
        /// </summary>
        public static Swsst BuildSwsstFromRow(DataRow row)
        {
            var entity = BuildSwsstBaseFromRow <Swsst>(row);

            return(entity);
        }
Ejemplo n.º 40
0
 static bool isCancellable(DataRow row) {
     return hasContent(row, "ferretOrderId") && !OrderTable.NOT_CANCELLABLE.Contains((string) row["status"]);
 }
Ejemplo n.º 41
0
 public static bool isFerretStaged(DataRow row) {
      return row["status"].Equals("Stage");
  }
Ejemplo n.º 42
0
 public void release(DataRow row) {
     FerretControl.release((string) row["ferretOrderId"], Dates.date((string) row["submittedTime"]));
 }
Ejemplo n.º 43
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TQC_QUA_RESULT DataRowToModel(DataRow row)
        {
            Mod_TQC_QUA_RESULT model = new Mod_TQC_QUA_RESULT();

            if (row != null)
            {
                if (row["C_ID"] != null)
                {
                    model.C_ID = row["C_ID"].ToString();
                }
                if (row["N_STATUS"] != null && row["N_STATUS"].ToString() != "")
                {
                    model.N_STATUS = decimal.Parse(row["N_STATUS"].ToString());
                }
                if (row["C_REMARK"] != null)
                {
                    model.C_REMARK = row["C_REMARK"].ToString();
                }
                if (row["C_EMP_ID"] != null)
                {
                    model.C_EMP_ID = row["C_EMP_ID"].ToString();
                }
                if (row["D_MOD_DT"] != null && row["D_MOD_DT"].ToString() != "")
                {
                    model.D_MOD_DT = DateTime.Parse(row["D_MOD_DT"].ToString());
                }
                if (row["N_SPLIT"] != null && row["N_SPLIT"].ToString() != "")
                {
                    model.N_SPLIT = decimal.Parse(row["N_SPLIT"].ToString());
                }
                if (row["N_TYPE"] != null && row["N_TYPE"].ToString() != "")
                {
                    model.N_TYPE = decimal.Parse(row["N_TYPE"].ToString());
                }
                if (row["C_STOVE"] != null)
                {
                    model.C_STOVE = row["C_STOVE"].ToString();
                }
                if (row["D_CREATETIME"] != null && row["D_CREATETIME"].ToString() != "")
                {
                    model.D_CREATETIME = DateTime.Parse(row["D_CREATETIME"].ToString());
                }
                if (row["C_ANANO"] != null && row["C_ANANO"].ToString() != "")
                {
                    model.C_ANANO = decimal.Parse(row["C_ANANO"].ToString());
                }
                if (row["C_COMMISSIONID"] != null)
                {
                    model.C_COMMISSIONID = row["C_COMMISSIONID"].ToString();
                }
                if (row["C_ANAITEM"] != null)
                {
                    model.C_ANAITEM = row["C_ANAITEM"].ToString();
                }
                if (row["N_ORIGINALVALUE"] != null && row["N_ORIGINALVALUE"].ToString() != "")
                {
                    model.N_ORIGINALVALUE = decimal.Parse(row["N_ORIGINALVALUE"].ToString());
                }
                if (row["C_GROUP"] != null)
                {
                    model.C_GROUP = row["C_GROUP"].ToString();
                }
                if (row["C_SHIFT"] != null)
                {
                    model.C_SHIFT = row["C_SHIFT"].ToString();
                }
                if (row["D_SHIFTDATE"] != null && row["D_SHIFTDATE"].ToString() != "")
                {
                    model.D_SHIFTDATE = DateTime.Parse(row["D_SHIFTDATE"].ToString());
                }
                if (row["C_SAMPID"] != null)
                {
                    model.C_SAMPID = row["C_SAMPID"].ToString();
                }
                if (row["C_SAMPSORT"] != null)
                {
                    model.C_SAMPSORT = row["C_SAMPSORT"].ToString();
                }
                if (row["C_IS_PD"] != null)
                {
                    model.C_IS_PD = row["C_IS_PD"].ToString();
                }
            }
            return(model);
        }
Ejemplo n.º 44
0
 /// <summary>
 ///Load Constructor 
 /// </summary>
 /// <param name="ctx">context</param>
 /// <param name="rs">result set(data row)</param>
 /// <param name="trxName">transaction</param>
 public MCardViewColumn(Ctx ctx, DataRow rs, Trx trxName)
     : base(ctx, rs, trxName)
 {
 }
Ejemplo n.º 45
0
    public static DataSet PrintDeliveryOrder(string orderNo, string jobType)
    {
        DataSet     set    = new DataSet();
        ObjectQuery query  = new ObjectQuery(typeof(C2.CtmJob), "JobNo='" + orderNo + "'", "");
        ObjectSet   objSet = C2.Manager.ORManager.GetObjectSet(query);

        if (objSet.Count == 0 || objSet[0] == null)
        {
            return(set);
        }
        C2.CtmJob obj = objSet[0] as C2.CtmJob;

        ObjectQuery query1  = new ObjectQuery(typeof(C2.JobHouse), "JobNo='" + orderNo + "'", "");
        ObjectSet   objSet1 = C2.Manager.ORManager.GetObjectSet(query1);


        #region init column
        DataTable mast = new DataTable("Mast");
        DataTable det  = new DataTable("Det");


        mast.Columns.Add("JobNo");
        mast.Columns.Add("JobDate");
        mast.Columns.Add("JobType");
        mast.Columns.Add("Haulier");
        mast.Columns.Add("Attn");
        mast.Columns.Add("DeliveryTo");
        mast.Columns.Add("PickupFrom");
        mast.Columns.Add("OceanBl");
        mast.Columns.Add("Yard");
        mast.Columns.Add("Carrier");
        mast.Columns.Add("CrNo");
        mast.Columns.Add("Contact1");
        mast.Columns.Add("Contact2");
        mast.Columns.Add("Tel1");
        mast.Columns.Add("Fax1");
        mast.Columns.Add("Terminal");
        mast.Columns.Add("Permit");
        mast.Columns.Add("LastDate");
        mast.Columns.Add("Portnet");
        mast.Columns.Add("Ft20");
        mast.Columns.Add("Ft40");
        mast.Columns.Add("Ft45");

        mast.Columns.Add("Vessel");
        mast.Columns.Add("Voyage");
        mast.Columns.Add("Etd");
        mast.Columns.Add("Eta");
        mast.Columns.Add("Pol");
        mast.Columns.Add("Pod");
        mast.Columns.Add("ByWho");
        mast.Columns.Add("ClientRefNo");
        mast.Columns.Add("PartyName");
        mast.Columns.Add("PartyAdd");
        mast.Columns.Add("AgentName");
        mast.Columns.Add("UserData2");
        mast.Columns.Add("UserData3");
        mast.Columns.Add("UserData4");
        mast.Columns.Add("Outside");
        mast.Columns.Add("Note1");
        mast.Columns.Add("Note2");
        mast.Columns.Add("UserId");
        mast.Columns.Add("Remark");
        mast.Columns.Add("SpecialInstruction");
        mast.Columns.Add("WarehouseCode");
        mast.Columns.Add("CrBkgNo");
        mast.Columns.Add("TotalQty");

        det.Columns.Add("No");
        det.Columns.Add("JobNo");
        det.Columns.Add("CargoStatus");
        det.Columns.Add("CargoType");
        det.Columns.Add("ContNo");
        det.Columns.Add("BookingNo");
        det.Columns.Add("HblNo");
        det.Columns.Add("OpsType");
        det.Columns.Add("Qty");
        det.Columns.Add("PackType");
        det.Columns.Add("SkuCode");
        det.Columns.Add("Weight");
        det.Columns.Add("PackQty");
        det.Columns.Add("PackUom");
        det.Columns.Add("Volume");
        det.Columns.Add("Location");
        det.Columns.Add("Length");
        det.Columns.Add("Width");
        det.Columns.Add("Height");
        det.Columns.Add("Marking1");
        det.Columns.Add("Marking2");
        det.Columns.Add("Remark1");


        #endregion

        DataRow   row         = mast.NewRow();
        string    sql_haulier = "select Name,CrNo,Contact1,Contact2,Tel1,Fax1 from xxparty where partyid='" + obj.ClientId + "'";
        DataTable tab_hauler  = Helper.Sql.List(sql_haulier);
        if (jobType == "gr")
        {
            row["JobType"] = "Goods Receipt Note".ToUpper();
        }
        if (jobType == "do")
        {
            row["JobType"] = "Delivery Order".ToUpper();
        }
        if (jobType == "tp")
        {
            row["JobType"] = "Transport Instruction".ToUpper();
        }
        if (jobType == "tr")
        {
            row["JobType"] = "Transfer Instruction".ToUpper();
        }
        row["Attn"]       = obj.Terminalcode;
        row["DeliveryTo"] = obj.DeliveryTo;
        row["PickupFrom"] = obj.PickupFrom;
        row["CrNo"]       = "";
        row["Contact1"]   = "";
        row["Contact2"]   = "";
        row["Tel1"]       = "";
        row["Fax1"]       = "";
        if (tab_hauler.Rows.Count > 0)
        {
            row["Haulier"]  = tab_hauler.Rows[0]["Name"];
            row["CrNo"]     = tab_hauler.Rows[0]["CrNo"].ToString();
            row["Contact1"] = tab_hauler.Rows[0]["Contact1"].ToString();
            row["Contact2"] = tab_hauler.Rows[0]["Contact2"].ToString();
            row["Tel1"]     = tab_hauler.Rows[0]["Tel1"].ToString();
            row["Fax1"]     = tab_hauler.Rows[0]["Fax1"].ToString();
        }

        row["JobNo"]   = orderNo;
        row["JobDate"] = obj.EtdDate.ToString("dd/MM/yyyy");
        row["Vessel"]  = obj.Vessel;
        row["Voyage"]  = obj.Voyage;
        row["Permit"]  = obj.PermitNo;

        string sql = "select name from xxparty where partyid='" + obj.ClientId + "'";
        row["PartyName"] = SafeValue.SafeString(ConnectSql.ExecuteScalar(sql), "");
        sql             = "select Address from xxparty where partyid='" + obj.ClientId + "'";
        row["PartyAdd"] = SafeValue.SafeString(ConnectSql.ExecuteScalar(sql), "");

        row["Etd"]                = obj.EtdDate.ToString("dd/MM/yyyy");
        row["Eta"]                = obj.EtaDate.ToString("dd/MM/yyyy");
        sql                       = "select name from [XXPort] where code='" + SafeValue.SafeString(obj.Pol, "") + "'";
        row["Pol"]                = SafeValue.SafeString(Helper.Sql.One(sql), "");
        sql                       = "select name from [XXPort] where code='" + SafeValue.SafeString(obj.Pod, "") + "'";
        row["Pod"]                = SafeValue.SafeString(Helper.Sql.One(sql), "");
        sql                       = "select name from xxparty where partyid='" + obj.CarrierId + "'";
        row["Carrier"]            = SafeValue.SafeString(Helper.Sql.One(sql), "");
        row["OceanBl"]            = obj.CarrierBlNo;
        row["CrBkgNo"]            = obj.CarrierBkgNo;
        row["Yard"]               = obj.YardRef;
        row["ByWho"]              = "";
        row["ClientRefNo"]        = obj.ClientRefNo;
        row["UserData2"]          = "";
        row["SpecialInstruction"] = obj.SpecialInstruction;
        row["Remark"]             = obj.Remark;
        row["UserId"]             = HttpContext.Current.User.Identity.Name;
        decimal total = 0;


        for (int i = 0; i < objSet1.Count; i++)
        {
            C2.JobHouse house = objSet1[i] as C2.JobHouse;
            DataRow     row1  = det.NewRow();
            row1["No"]          = i + 1;
            row1["JobNo"]       = orderNo;
            row1["ContNo"]      = house.ContNo;
            row1["CargoStatus"] = house.CargoStatus;
            row1["CargoType"]   = house.CargoType;
            row1["Location"]    = house.Location;
            row1["BookingNo"]   = house.BookingNo;
            row1["HblNo"]       = house.HblNo;
            row1["Length"]      = house.LengthPack;
            row1["Width"]       = house.WidthPack;
            row1["Height"]      = house.HeightPack;
            row1["Weight"]      = house.WeightOrig;
            row1["Volume"]      = house.WeightOrig;
            row1["Qty"]         = house.QtyOrig;
            row1["PackType"]    = house.PackTypeOrig;
            row1["PackQty"]     = house.PackQty;
            row1["PackUom"]     = house.PackUom;
            total += house.QtyOrig;
            det.Rows.Add(row1);
        }
        row["TotalQty"] = total;
        mast.Rows.Add(row);

        set.Tables.Add(mast);
        set.Tables.Add(det);

        return(set);
    }
Ejemplo n.º 46
0
    public static DataTable DsReceipt(string recNo)
    {
        DataTable tab = new DataTable();

        #region init column
        tab.Columns.Add("Title");
        tab.Columns.Add("JobType");
        tab.Columns.Add("BarCode");
        tab.Columns.Add("CustCode");
        tab.Columns.Add("Port");

        tab.Columns.Add("RecNo");
        tab.Columns.Add("RecDate");
        tab.Columns.Add("RecTime");
        tab.Columns.Add("RecFrom");
        tab.Columns.Add("Markings");
        tab.Columns.Add("Contents");
        tab.Columns.Add("ContNo");
        tab.Columns.Add("ComplDate");
        tab.Columns.Add("ComplTime");
        tab.Columns.Add("Qty");
        tab.Columns.Add("PackType");
        tab.Columns.Add("M3");
        tab.Columns.Add("Weight");
        tab.Columns.Add("UserId");
        tab.Columns.Add("SpcRemark");
        tab.Columns.Add("InternalExternal");

        tab.Columns.Add("ForkLift");
        tab.Columns.Add("Dn");
        tab.Columns.Add("Tracing");
        tab.Columns.Add("Wh");
        tab.Columns.Add("Admin");
        tab.Columns.Add("Sr");
        tab.Columns.Add("Removal");
        tab.Columns.Add("Ot");
        tab.Columns.Add("LongLength");
        tab.Columns.Add("OverWeight");
        tab.Columns.Add("Sticker");
        tab.Columns.Add("Ugt");
        tab.Columns.Add("Sec");
        tab.Columns.Add("Dg");
        tab.Columns.Add("Misc");
        tab.Columns.Add("Other");
        tab.Columns.Add("Waive");
        tab.Columns.Add("Total");
        tab.Columns.Add("OtherRemarks");
        tab.Columns.Add("VesVoy");

        tab.Columns.Add("BillAmt");

        tab.Columns.Add("DoNo");
        tab.Columns.Add("IsCn");
        tab.Columns.Add("Cn");
        tab.Columns.Add("HblN");
        tab.Columns.Add("JobOrder");
        tab.Columns.Add("ClearRmk");


        tab.Columns.Add("VehicleUser");
        tab.Columns.Add("VehicleTel");
        tab.Columns.Add("VehicleNric");
        tab.Columns.Add("VehicleNo1");
        tab.Columns.Add("VehicleNo2");
        tab.Columns.Add("VehicleNo3");
        tab.Columns.Add("QtyWord");
        tab.Columns.Add("TotQty");
        #endregion

        ObjectQuery query  = new ObjectQuery(typeof(C2.CtmJob), "JobNo='" + recNo + "'", "");
        ObjectSet   objSet = C2.Manager.ORManager.GetObjectSet(query);

        C2.CtmJob job = objSet[0] as C2.CtmJob;

        ObjectQuery query1  = new ObjectQuery(typeof(C2.JobHouse), "JobNo='" + recNo + "'", "");
        ObjectSet   objSet1 = C2.Manager.ORManager.GetObjectSet(query1);

        DataRow row = tab.NewRow();
        if (objSet1.Count > 0 && objSet1[0] != null)
        {
            C2.JobHouse obj = objSet1[0] as C2.JobHouse;

            if (job.JobType == "DO")
            {
                row["Title"] = "DELIVERY NOTE";
            }
            if (job.JobType == "GR")
            {
                row["Title"] = "CARGO RECEIPT";
            }
            if (job.JobType == "TP")
            {
                row["Title"] = "CARGO DIRECT RELEASE";
            }
            row["JobType"]  = obj.JobType;
            row["BarCode"]  = "04-" + job.JobNo + "-00";
            row["RecNo"]    = obj.JobNo;
            row["RecDate"]  = job.JobDate.ToString("dd/MM/yyyy");
            row["RecTime"]  = job.JobDate.ToString("HH:mm");
            row["JobOrder"] = job.JobNo;
            row["RecFrom"]  = EzshipHelper.GetPartyName(obj.ClientId);

            row["CustCode"] = obj.ClientId;
            string agCode = "";


            //row["Port"] = obj.JobType=="E" ? obj.PortDisc : obj.PortLoad;
            row["Markings"]  = obj.Marking1;
            row["Contents"]  = obj.Marking2;
            row["ContNo"]    = obj.ContNo;
            row["ComplDate"] = job.UpdateDateTime.ToString("dd/MM/yyyy");
            row["ComplTime"] = job.UpdateDateTime.ToString("HH:mm");
            row["HblN"]      = obj.HblNo;
            row["Qty"]       = obj.Qty.ToString();
            row["PackType"]  = obj.UomCode;
            row["M3"]        = obj.Volume.ToString("0.000");
            row["Weight"]    = obj.Weight.ToString("0.000");
            row["UserId"]    = job.CreateBy;

            string value = SafeValue.SafeString("0.00");
            row["ForkLift"]   = value;
            row["Dn"]         = value;
            row["Tracing"]    = value;
            row["Wh"]         = value;
            row["Admin"]      = value;
            row["Sr"]         = value;
            row["Removal"]    = value;
            row["Dg"]         = value;
            row["Sec"]        = value;
            row["LongLength"] = Helper.Safe.SafeDecimal(value).ToString("0.00");
            row["OverWeight"] = Helper.Safe.SafeDecimal(value).ToString("0.00");
            row["Sticker"]    = Helper.Safe.SafeDecimal(value).ToString("0.00");
            row["Ot"]         = value;
            row["Ugt"]        = value;
            row["Misc"]       = value;
            row["Other"]      = value;
            //if (obj.WaiveAmt == 0)
            //    row["Waive"] = "0.00";
            //else
            //    row["Waive"] = "(" + obj.WaiveAmt.ToString("0.00") + ")";

            row["Total"]        = value;
            row["OtherRemarks"] = obj.Remark1;
            row["IsCn"]         = "DELIVERY NOTE/OFFICIAL RECEIPT";
            row["Cn"]           = "";

            row["VesVoy"]      = job.Vessel + " / " + job.Voyage;
            row["DoNo"]        = "";
            row["ClearRmk"]    = "";
            row["VehicleUser"] = "";
            row["VehicleTel"]  = "";
            row["VehicleNric"] = "";
            row["VehicleNo1"]  = "";
            row["VehicleNo2"]  = "";
            row["VehicleNo3"]  = "";
            NumberToMoney num = new NumberToMoney();
            string        s   = num.NumberToCurrency(Convert.ToDecimal(obj.Qty));
            row["QtyWord"]          = s + " " + obj.UomCode;
            row["TotQty"]           = obj.Qty;
            row["SpcRemark"]        = "";
            row["InternalExternal"] = S.Text("") == "CO-LOAD" ? "Internal" : "External";
        }
        tab.Rows.Add(row);

        return(tab);
    }
Ejemplo n.º 47
0
    public static DataSet PrintImpHaulier(string orderNo)
    {
        DataSet     set    = new DataSet();
        ObjectQuery query  = new ObjectQuery(typeof(C2.CtmJob), "JobNo='" + orderNo + "'", "");
        ObjectSet   objSet = C2.Manager.ORManager.GetObjectSet(query);

        if (objSet.Count == 0 || objSet[0] == null)
        {
            return(set);
        }
        C2.CtmJob obj = objSet[0] as C2.CtmJob;

        ObjectQuery query1  = new ObjectQuery(typeof(C2.CtmJobDet1), "JobNo='" + orderNo + "'", "ContainerNo");
        ObjectSet   objSet1 = C2.Manager.ORManager.GetObjectSet(query1);

        #region init column
        DataTable mast = new DataTable("Mast");
        DataTable det  = new DataTable("Det");

        mast.Columns.Add("JobOrderNo");
        mast.Columns.Add("Haulier");
        mast.Columns.Add("OceanBl");
        mast.Columns.Add("Yard");
        mast.Columns.Add("Carrier");
        mast.Columns.Add("CrNo");
        mast.Columns.Add("Contact1");
        mast.Columns.Add("Contact2");
        mast.Columns.Add("Tel1");
        mast.Columns.Add("Fax1");
        mast.Columns.Add("Terminal");
        mast.Columns.Add("Permit");
        mast.Columns.Add("LastDate");
        mast.Columns.Add("Portnet");
        mast.Columns.Add("Ft20");
        mast.Columns.Add("Ft40");
        mast.Columns.Add("Ft45");
        mast.Columns.Add("DeliveryTo");
        mast.Columns.Add("VesselNo");
        mast.Columns.Add("VoyNo");
        mast.Columns.Add("Etd");
        mast.Columns.Add("Eta");
        mast.Columns.Add("PortLoad");
        mast.Columns.Add("ByWho");
        mast.Columns.Add("ImpRefNo");
        mast.Columns.Add("CustName");
        mast.Columns.Add("AgentName");
        mast.Columns.Add("UserData2");
        mast.Columns.Add("UserData3");
        mast.Columns.Add("UserData4");
        mast.Columns.Add("Outside");
        mast.Columns.Add("Note1");
        mast.Columns.Add("Note2");
        mast.Columns.Add("StampUser");

        det.Columns.Add("Idx");
        det.Columns.Add("JobOrderNo");
        det.Columns.Add("ContNo");
        det.Columns.Add("SealNo");
        det.Columns.Add("FtSize");
        det.Columns.Add("FtRemark");
        det.Columns.Add("FtType");
        det.Columns.Add("FtKgs");
        det.Columns.Add("FtQty");
        det.Columns.Add("FtPack");
        det.Columns.Add("FtTruckIn");
        det.Columns.Add("FtCbm");
        det.Columns.Add("FtNom");

        #endregion

        DataRow   row         = mast.NewRow();
        string    sql_haulier = "select Name,CrNo,Contact1,Contact2,Tel1,Fax1 from xxparty where partyid='" + obj.HaulierId + "'";
        DataTable tab_hauler  = Helper.Sql.List(sql_haulier);
        row["Haulier"]  = "";
        row["CrNo"]     = "";
        row["Contact1"] = "";
        row["Contact2"] = "";
        row["Tel1"]     = "";
        row["Fax1"]     = "";
        if (tab_hauler.Rows.Count > 0)
        {
            row["Haulier"]  = tab_hauler.Rows[0]["Name"];
            row["CrNo"]     = tab_hauler.Rows[0]["CrNo"].ToString();
            row["Contact1"] = tab_hauler.Rows[0]["Contact1"].ToString();
            row["Contact2"] = tab_hauler.Rows[0]["Contact2"].ToString();
            row["Tel1"]     = tab_hauler.Rows[0]["Tel1"].ToString();
            row["Fax1"]     = tab_hauler.Rows[0]["Fax1"].ToString();
        }

        row["JobOrderNo"] = orderNo;
        row["VesselNo"]   = obj.Vessel;
        row["VoyNo"]      = obj.Voyage;
        row["DeliveryTo"] = Helper.Sql.One(string.Format(@"select Address from xxparty where PartyId='{0}'", obj.ClientId));
        row["Ft20"]       = 0;
        row["Ft40"]       = 0;
        row["Ft45"]       = 0;

        string sql = "select name from xxparty where partyid='" + SafeValue.SafeInt(obj.ClientId, 0) + "'";
        row["CustName"] = SafeValue.SafeString(Helper.Sql.One(sql), "");

        sql = "select name from xxparty where partyid='" + SafeValue.SafeInt(obj.CarrierId, 0) + "'";
        row["AgentName"] = SafeValue.SafeString(Helper.Sql.One(sql), "");

        row["Etd"]      = obj.EtdDate.ToString("dd/MM/yyyy");
        row["Eta"]      = obj.EtaDate.ToString("dd/MM/yyyy");
        sql             = "select name from [XXPort] where code='" + SafeValue.SafeString(obj.Pol, "") + "'";
        row["PortLoad"] = SafeValue.SafeString(Helper.Sql.One(sql), obj.Pol);

        row["Carrier"]   = obj.CarrierId;
        row["OceanBl"]   = "";
        row["Yard"]      = obj.YardRef;
        row["ByWho"]     = obj.CreateBy;
        row["ImpRefNo"]  = obj.ClientRefNo;
        row["UserData2"] = "";
        row["Note1"]     = obj.SpecialInstruction;
        row["StampUser"] = obj.CreateBy;

        mast.Rows.Add(row);

        for (int i = 0; i < objSet1.Count; i++)
        {
            C2.CtmJobDet1 cont     = objSet1[i] as C2.CtmJobDet1;
            DataRow       row1     = det.NewRow();
            string        contType = cont.ContainerType;
            row1["JobOrderNo"] = orderNo;
            row1["ContNo"]     = cont.ContainerNo;
            row1["SealNo"]     = cont.SealNo;
            string ftSize = "";
            if (contType.Substring(0, 2) == "20")
            {
                ftSize = "20";
            }
            if (contType.Substring(0, 2) == "40")
            {
                ftSize += "40";
            }
            if (contType.Substring(0, 2) == "45")
            {
                ftSize += "45";
            }
            row1["FtSize"] = ftSize;
            row1["FtType"] = "";

            row1["FtQty"]     = cont.Qty;
            row1["FtKgs"]     = cont.Weight.ToString("0");
            row1["FtCbm"]     = cont.Volume.ToString("#,##0.00");
            row1["FtTruckIn"] = "TRUCK-IN:" + cont.ScheduleDate.ToString("dd-MMM");
            det.Rows.Add(row1);
        }
        set.Tables.Add(mast);
        set.Tables.Add(det);
        set.Relations.Add("", mast.Columns["JobOrderNo"], det.Columns["JobOrderNo"]);
        return(set);
    }
Ejemplo n.º 48
0
    public static DataSet PrintTallySheet(string orderNo, string jobType)
    {
        DataSet     set    = new DataSet();
        ObjectQuery query  = new ObjectQuery(typeof(C2.CtmJob), "JobNo='" + orderNo + "'", "");
        ObjectSet   objSet = C2.Manager.ORManager.GetObjectSet(query);

        if (objSet.Count == 0 || objSet[0] == null)
        {
            return(set);
        }
        C2.CtmJob obj = objSet[0] as C2.CtmJob;

        #region init column
        DataTable mast = new DataTable("Mast");
        DataTable det  = new DataTable("Details");
        mast.Columns.Add("JobNo");
        mast.Columns.Add("JobType");
        mast.Columns.Add("Haulier");
        mast.Columns.Add("Attn");
        mast.Columns.Add("DeliveryTo");
        mast.Columns.Add("OceanBl");
        mast.Columns.Add("Yard");
        mast.Columns.Add("Carrier");
        mast.Columns.Add("CrNo");
        mast.Columns.Add("Contact1");
        mast.Columns.Add("Contact2");
        mast.Columns.Add("Tel1");
        mast.Columns.Add("Fax1");
        mast.Columns.Add("Terminal");
        mast.Columns.Add("Permit");
        mast.Columns.Add("LastDate");
        mast.Columns.Add("Portnet");
        mast.Columns.Add("ContNo");
        mast.Columns.Add("SealNo");
        mast.Columns.Add("Ft20");
        mast.Columns.Add("Ft40");
        mast.Columns.Add("Ft45");
        mast.Columns.Add("FtSize");
        mast.Columns.Add("ContType");
        mast.Columns.Add("CarrierBkgNo");
        mast.Columns.Add("Vessel");
        mast.Columns.Add("Voyage");
        mast.Columns.Add("Etd");
        mast.Columns.Add("Eta");
        mast.Columns.Add("Pol");
        mast.Columns.Add("ByWho");
        mast.Columns.Add("ClientRefNo");
        mast.Columns.Add("CustName");
        mast.Columns.Add("AgentName");
        mast.Columns.Add("UserData2");
        mast.Columns.Add("UserData3");
        mast.Columns.Add("UserData4");
        mast.Columns.Add("Outside");
        mast.Columns.Add("Note1");
        mast.Columns.Add("Note2");
        mast.Columns.Add("StampUser");
        mast.Columns.Add("Remark");
        mast.Columns.Add("SpecialInstruction");

        det.Columns.Add("TotalQty");
        det.Columns.Add("TotalM3");

        det.Columns.Add("No");
        det.Columns.Add("JobNo");
        det.Columns.Add("ContNo");
        det.Columns.Add("BookingNo");
        det.Columns.Add("HblNo");
        det.Columns.Add("OpsType");
        det.Columns.Add("Qty");
        det.Columns.Add("Uom");
        det.Columns.Add("QtyOrig");
        det.Columns.Add("WeightOrig");
        det.Columns.Add("VolumeOrig");
        det.Columns.Add("PackType");
        det.Columns.Add("SkuCode");
        det.Columns.Add("Weight");
        det.Columns.Add("PackQty");
        det.Columns.Add("PackUom");
        det.Columns.Add("Volume");
        det.Columns.Add("Location");
        det.Columns.Add("Length");
        det.Columns.Add("Width");
        det.Columns.Add("Height");
        det.Columns.Add("Marking1");
        det.Columns.Add("Marking2");
        det.Columns.Add("Remark1");
        det.Columns.Add("Pod");
        #endregion

        #region Data
        string contNo   = "";
        string contType = "";


        DataRow   row         = mast.NewRow();
        string    sql_haulier = "select Name,CrNo,Contact1,Contact2,Tel1,Fax1 from xxparty where partyid='" + obj.ClientId + "'";
        DataTable tab_hauler  = Helper.Sql.List(sql_haulier);
        row["Attn"]       = obj.Terminalcode;
        row["DeliveryTo"] = obj.DeliveryTo;
        row["CrNo"]       = "";
        row["Contact1"]   = "";
        row["Contact2"]   = "";
        row["Tel1"]       = "";
        row["Fax1"]       = "";
        if (tab_hauler.Rows.Count > 0)
        {
            row["Haulier"]  = tab_hauler.Rows[0]["Name"];
            row["CrNo"]     = tab_hauler.Rows[0]["CrNo"].ToString();
            row["Contact1"] = tab_hauler.Rows[0]["Contact1"].ToString();
            row["Contact2"] = tab_hauler.Rows[0]["Contact2"].ToString();
            row["Tel1"]     = tab_hauler.Rows[0]["Tel1"].ToString();
            row["Fax1"]     = tab_hauler.Rows[0]["Fax1"].ToString();
        }
        row["CarrierBkgNo"] = obj.CarrierBkgNo;
        row["JobNo"]        = orderNo;
        row["JobType"]      = obj.JobType;
        row["Vessel"]       = obj.Vessel;
        row["Voyage"]       = obj.Voyage;
        row["Permit"]       = obj.PermitNo;

        string sql = "select name from xxparty where partyid='" + obj.ClientId + "'";
        row["CustName"] = SafeValue.SafeString(ConnectSql.ExecuteScalar(sql), "");



        row["Etd"] = obj.EtdDate.ToString("dd/MM/yyyy");
        row["Eta"] = obj.EtaDate.ToString("dd/MM/yyyy");
        sql        = "select name from [XXPort] where code='" + SafeValue.SafeString(obj.Pol, "") + "'";
        row["Pol"] = SafeValue.SafeString(Helper.Sql.One(sql), "");

        sql                       = "select name from xxparty where partyid='" + obj.CarrierId + "'";
        row["Carrier"]            = SafeValue.SafeString(Helper.Sql.One(sql), "");
        row["OceanBl"]            = obj.CarrierBlNo;
        row["Yard"]               = obj.YardRef;
        row["ByWho"]              = "";
        row["ClientRefNo"]        = obj.ClientRefNo;
        row["UserData2"]          = "";
        row["SpecialInstruction"] = obj.SpecialInstruction;
        row["Remark"]             = obj.Remark;
        row["StampUser"]          = HttpContext.Current.User.Identity.Name;

        int n = 0;

        sql = string.Format(@"select ContainerNo,ContainerType from Ctm_JobDet1 where JobNo='{0}'", orderNo);
        DataTable tab_cont = ConnectSql_mb.GetDataTable(sql);
        for (int a = 0; a < tab_cont.Rows.Count; a++)
        {
            contNo         = SafeValue.SafeString(tab_cont.Rows[a]["ContainerNo"]);
            contType       = SafeValue.SafeString(tab_cont.Rows[a]["ContainerType"]);
            row["ContNo"] += contNo + " " + contType + " / ";
        }

        decimal total      = 0;
        decimal m3         = 0;
        string  lastContNo = "";
        sql = string.Format(@"select *  from job_house where JobNo='{0}' order by Id asc", orderNo);
        DataTable dt_det = ConnectSql_mb.GetDataTable(sql);

        for (int i = 0; i < dt_det.Rows.Count; i++)
        {
            DataRow rowDet = dt_det.Rows[i];
            DataRow row1   = det.NewRow();

            row1["No"]         = n + 1;
            row1["ContNo"]     = rowDet["ContNo"];
            row1["JobNo"]      = orderNo;
            row1["BookingNo"]  = rowDet["BookingNo"];
            row1["HblNo"]      = rowDet["HblNo"];
            row1["Length"]     = rowDet["LengthPack"];
            row1["Width"]      = rowDet["WidthPack"];
            row1["Height"]     = rowDet["HeightPack"];
            row1["Weight"]     = rowDet["Weight"];
            row1["Volume"]     = rowDet["Volume"];
            row1["Qty"]        = SafeValue.SafeDecimal(rowDet["Qty"], 0);
            row1["Uom"]        = SafeValue.SafeDecimal(rowDet["UomCode"], 0);
            row1["QtyOrig"]    = SafeValue.SafeDecimal(rowDet["QtyOrig"], 0);
            row1["VolumeOrig"] = SafeValue.SafeDecimal(rowDet["VolumeOrig"], 0);
            row1["WeightOrig"] = rowDet["WeightOrig"];
            row1["PackType"]   = rowDet["PackTypeOrig"];
            row1["PackQty"]    = rowDet["PackQty"];
            row1["PackUom"]    = rowDet["PackUom"];
            sql         = "select name from [XXPort] where code='" + SafeValue.SafeString(obj.Pod, "") + "'";
            row1["Pod"] = SafeValue.SafeString(Helper.Sql.One(sql), "");
            total      += SafeValue.SafeDecimal(rowDet["QtyOrig"], 0);
            m3         += SafeValue.SafeDecimal(rowDet["VolumeOrig"], 0);

            n++;
            det.Rows.Add(row1);
        }
        mast.Rows.Add(row);
        #endregion


        set.Tables.Add(mast);
        set.Tables.Add(det);
        //int count = mast.Rows.Count;
        //int m = det.Rows.Count;
        //set.Relations.Add("", mast.Columns["ContNo"], det.Columns["ContNo"]);
        return(set);
    }
Ejemplo n.º 49
0
        /// <summary>
        /// 保存,返修批次。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbOK_Click(object sender, EventArgs e)
        {
            if (this.gvHoldInfoList.State == GridState.Editing &&
                this.gvHoldInfoList.IsEditorFocused &&
                this.gvHoldInfoList.EditingValueModified)
            {
                this.gvHoldInfoList.SetFocusedRowCellValue(this.gvHoldInfoList.FocusedColumn, this.gvHoldInfoList.EditingValue);
            }
            this.gvHoldInfoList.UpdateCurrentRow();
            //待返工批次信息
            DataTable dtLotInfo = this.gcLotList.DataSource as DataTable;

            if (dtLotInfo == null || dtLotInfo.Rows.Count < 1)
            {
                MessageService.ShowMessage("待返工批次信息列表至少要有一条记录。", "提示");
                return;
            }
            //暂停信息
            DataTable dtHoldInfo = this.gcHoldInfoList.DataSource as DataTable;

            if (dtHoldInfo.Rows.Count < 1)
            {
                MessageService.ShowMessage("暂停信息列表至少要有一条记录。", "提示");
                return;
            }
            string newEnterpriseName = this.beEnterpriseName.Text;
            string newEnterpriseKey  = Convert.ToString(this.beEnterpriseName.Tag);
            string newRouteName      = this.teRouteName.Text;
            string newRouteKey       = Convert.ToString(this.teRouteName.Tag);
            string newStepName       = this.teStepName.Text;
            string newStepKey        = Convert.ToString(this.teStepName.Tag);

            //返工工艺流程必须选择
            if (string.IsNullOrEmpty(newStepKey))
            {
                MessageService.ShowMessage("请选择工艺流程。", "提示");
                this.beEnterpriseName_ButtonClick(this.teStepName, new ButtonPressedEventArgs(new EditorButton()));
                return;
            }
            string remark = this.teRemark.Text.Trim();

            if (string.IsNullOrEmpty(remark))
            {
                MessageService.ShowMessage("备注必须输入。", "提示");
                this.teRemark.Select();
                return;
            }

            StringBuilder afterContent = new StringBuilder();

            afterContent.AppendFormat("工艺流程组:{0};", newEnterpriseName);
            afterContent.AppendFormat("工艺流程:{0};", newRouteName);
            afterContent.AppendFormat("工序:{0};", newStepName);
            //密码和释放密码不一致
            var lnq = from item in dtHoldInfo.AsEnumerable()
                      where Convert.ToString(item[TEMP_HOLD_LIST_RELEASE_PASSWORD]) != Convert.ToString(item[WIP_HOLD_RELEASE_FIELDS.FIELD_HOLD_PASSWORD])
                      select item;

            foreach (var item in lnq)
            {
                MessageService.ShowMessage("释放密码和暂停密码不一致,请确认。", "提示");
                this.gvHoldInfoList.FocusedColumn    = this.gclPassword;
                this.gvHoldInfoList.FocusedRowHandle = dtHoldInfo.Rows.IndexOf(item);
                this.gvHoldInfoList.ShowEditor();
                return;
            }

            string shiftName = this._model.ShiftName;
            string shiftKey  = string.Empty;
            //Shift shiftEntity = new Shift();
            //string shiftKey = shiftEntity.IsShiftValueExists(shiftName);//班次主键。
            ////获取班次主键失败。
            //if (!string.IsNullOrEmpty(shiftEntity.ErrorMsg))
            //{
            //    MessageService.ShowError(shiftEntity.ErrorMsg);
            //    return;
            //}
            ////没有排班。
            //if (string.IsNullOrEmpty(shiftKey))
            //{
            //    MessageService.ShowMessage("请先在系统中进行排班。", "提示");
            //    return;
            //}
            string oprComputer = PropertyService.Get(PROPERTY_FIELDS.COMPUTER_NAME);
            string timezone    = PropertyService.Get(PROPERTY_FIELDS.TIMEZONE);

            DataSet dsParams = new DataSet();
            //存放批次返工信息。
            Hashtable htMaindata = new Hashtable();

            htMaindata.Add(POR_LOT_FIELDS.FIELD_ROUTE_ENTERPRISE_VER_KEY, newEnterpriseKey);
            htMaindata.Add(POR_LOT_FIELDS.FIELD_CUR_ROUTE_VER_KEY, newRouteKey);
            htMaindata.Add(POR_LOT_FIELDS.FIELD_CUR_STEP_VER_KEY, newStepKey);
            DataTable dtMaindata = CommonUtils.ParseToDataTable(htMaindata);

            dtMaindata.TableName = TRANS_TABLES.TABLE_MAIN_DATA;
            //存放待返工的批次的操作数据
            WIP_TRANSACTION_FIELDS transFields = new WIP_TRANSACTION_FIELDS();
            DataTable dtTransaction            = CommonUtils.CreateDataTable(transFields);
            //存在批次返工操作的明细记录。
            WIP_COMMENT_FIELDS commentFileds = new WIP_COMMENT_FIELDS();
            DataTable          dtComment     = CommonUtils.CreateDataTable(commentFileds);

            foreach (DataRow dr in dtLotInfo.Rows)
            {
                string transKey = CommonUtils.GenerateNewKey(0);
                string lotKey   = Convert.ToString(dr[POR_LOT_FIELDS.FIELD_LOT_KEY]);
                //组织待返工的批次的操作数据
                DataRow drTransaction = dtTransaction.NewRow();
                dtTransaction.Rows.Add(drTransaction);
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_TRANSACTION_KEY]  = transKey;
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_PIECE_KEY]        = lotKey;
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_ACTIVITY]         = ACTIVITY_FIELD_VALUES.FIELD_ACTIVITY_REWORK;
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_QUANTITY_IN]      = dr[POR_LOT_FIELDS.FIELD_QUANTITY];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_QUANTITY_OUT]     = dr[POR_LOT_FIELDS.FIELD_QUANTITY];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_ENTERPRISE_KEY]   = dr[POR_LOT_FIELDS.FIELD_ROUTE_ENTERPRISE_VER_KEY];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_ENTERPRISE_NAME]  = dr[POR_ROUTE_ENTERPRISE_VER_FIELDS.FIELD_ENTERPRISE_NAME];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_ROUTE_KEY]        = dr[POR_LOT_FIELDS.FIELD_CUR_ROUTE_VER_KEY];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_ROUTE_NAME]       = dr[POR_ROUTE_ROUTE_VER_FIELDS.FIELD_ROUTE_NAME];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_STEP_KEY]         = dr[POR_LOT_FIELDS.FIELD_CUR_STEP_VER_KEY];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_STEP_NAME]        = dr[POR_ROUTE_STEP_FIELDS.FIELD_ROUTE_STEP_NAME];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_WORK_ORDER_KEY]   = dr[POR_LOT_FIELDS.FIELD_WORK_ORDER_KEY];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_SHIFT_KEY]        = shiftKey;
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_SHIFT_NAME]       = shiftName;
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_STATE_FLAG]       = dr[POR_LOT_FIELDS.FIELD_STATE_FLAG];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_REWORK_FLAG]      = dr[POR_LOT_FIELDS.FIELD_IS_REWORKED];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_OPERATOR]         = this._model.UserName;
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_OPR_COMPUTER]     = oprComputer;
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_LINE_KEY]         = dr[POR_LOT_FIELDS.FIELD_CUR_PRODUCTION_LINE_KEY];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_OPR_LINE]         = dr[POR_LOT_FIELDS.FIELD_OPR_LINE];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_OPR_LINE_PRE]     = dr[POR_LOT_FIELDS.FIELD_OPR_LINE_PRE];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_EDC_INS_KEY]      = dr[POR_LOT_FIELDS.FIELD_EDC_INS_KEY];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_EQUIPMENT_KEY]    = dr[EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_KEY];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_ACTIVITY_COMMENT] = remark;
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_EDITOR]           = this._model.UserName;
                //用于暂存序列号批次信息最后的编辑时间,以便判断序列号信息是否过期。
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_EDIT_TIME]         = dr[POR_LOT_FIELDS.FIELD_EDIT_TIME];
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_EDIT_TIMEZONE_KEY] = timezone;
                drTransaction[WIP_TRANSACTION_FIELDS.FIELD_TIME_STAMP]        = DBNull.Value;
                //组织新的工艺流程数据
                DataRow drComment = dtComment.NewRow();
                dtComment.Rows.Add(drComment);
                drComment[WIP_COMMENT_FIELDS.FIELDS_TRANSACTION_KEY] = transKey;
                drComment[WIP_COMMENT_FIELDS.FIELDS_EDIT_TIMEZONE]   = timezone;
                drComment[WIP_COMMENT_FIELDS.FIELDS_EDIT_TIME]       = DBNull.Value;
                drComment[WIP_COMMENT_FIELDS.FIELDS_EDITOR]          = this._model.UserName;
                drComment[WIP_COMMENT_FIELDS.FIELDS_ENTERPRISE_KEY]  = newEnterpriseKey;
                drComment[WIP_COMMENT_FIELDS.FIELDS_ROUTE_KEY]       = newRouteKey;
                drComment[WIP_COMMENT_FIELDS.FIELDS_STEP_KEY]        = newStepKey;
                StringBuilder beforeContent = new StringBuilder();
                beforeContent.AppendFormat("工艺流程组:{0};", dr[POR_ROUTE_ENTERPRISE_VER_FIELDS.FIELD_ENTERPRISE_NAME]);
                beforeContent.AppendFormat("工艺流程:{0};", dr[POR_ROUTE_ROUTE_VER_FIELDS.FIELD_ROUTE_NAME]);
                beforeContent.AppendFormat("工序:{0};", dr[POR_ROUTE_STEP_FIELDS.FIELD_ROUTE_STEP_NAME]);
                drComment[WIP_COMMENT_FIELDS.FIELDS_BEFORE_CONTENT] = beforeContent;
                drComment[WIP_COMMENT_FIELDS.FIELDS_AFTER_CONTENT]  = afterContent;
                //组织暂停批次信息。
                lnq = from item in dtHoldInfo.AsEnumerable()
                      where Convert.ToString(item[POR_LOT_FIELDS.FIELD_LOT_KEY]) == lotKey
                      select item;
                foreach (DataRow drHoldInfo in lnq)
                {
                    drHoldInfo[WIP_HOLD_RELEASE_FIELDS.FIELD_RELEASE_TRANSACTION_KEY] = transKey;
                    drHoldInfo[WIP_HOLD_RELEASE_FIELDS.FIELD_RELEASE_DESCRIPTION]     = remark;
                    drHoldInfo[WIP_HOLD_RELEASE_FIELDS.FIELD_RELEASE_OPERATOR]        = this._model.UserName;
                    drHoldInfo[WIP_HOLD_RELEASE_FIELDS.FIELD_RELEASE_TIMEZONE]        = timezone;
                    drHoldInfo[WIP_HOLD_RELEASE_FIELDS.FIELD_EDITOR]        = this._model.UserName;
                    drHoldInfo[WIP_HOLD_RELEASE_FIELDS.FIELD_EDIT_TIMEZONE] = timezone;
                }
            }
            //存放暂停明细。
            DataTable dtHoldParams = dtHoldInfo.Copy();

            dtHoldParams.Columns.Remove(TEMP_HOLD_LIST_RELEASE_PASSWORD);     //移除临时列。
            dtHoldParams.Columns.Remove(POR_LOT_FIELDS.FIELD_LOT_KEY);        //移除批次主键列。
            dtHoldParams.Columns.Remove(POR_LOT_FIELDS.FIELD_LOT_NUMBER);     //移除批次号列。

            dsParams.Tables.Add(dtMaindata);
            dsParams.Tables.Add(dtTransaction);
            dsParams.Tables.Add(dtHoldParams);
            dsParams.Tables.Add(dtComment);
            //执行(返工/返修)批次。
            this._entity.LotRework(dsParams);
            if (!string.IsNullOrEmpty(this._entity.ErrorMsg))
            {
                MessageService.ShowError(this._entity.ErrorMsg);
            }
            else
            {
                this.tsbCancle_Click(sender, e);
            }
            dsParams.Tables.Clear();
            dtTransaction = null;
            dtHoldParams  = null;
            dtComment     = null;
            dsParams      = null;
        }
Ejemplo n.º 50
0
    public static DataSet PrintHaulier(string orderNo, string jobType)
    {
        DataSet     set    = new DataSet();
        ObjectQuery query  = new ObjectQuery(typeof(C2.CtmJob), "JobNo='" + orderNo + "'", "");
        ObjectSet   objSet = C2.Manager.ORManager.GetObjectSet(query);

        if (objSet.Count == 0 || objSet[0] == null)
        {
            return(set);
        }
        C2.CtmJob obj = objSet[0] as C2.CtmJob;

        ObjectQuery query1  = new ObjectQuery(typeof(C2.CtmJobDet1), "JobNo='" + orderNo + "'", "");
        ObjectSet   objSet1 = C2.Manager.ORManager.GetObjectSet(query1);


        #region init column
        DataTable mast = new DataTable("Mast");
        DataTable det  = new DataTable("Det");

        mast.Columns.Add("JobNo");
        mast.Columns.Add("JobType");
        mast.Columns.Add("Haulier");
        mast.Columns.Add("Attn");
        mast.Columns.Add("DeliveryTo");
        mast.Columns.Add("OceanBl");
        mast.Columns.Add("Yard");
        mast.Columns.Add("Carrier");
        mast.Columns.Add("CrNo");
        mast.Columns.Add("Contact1");
        mast.Columns.Add("Contact2");
        mast.Columns.Add("Tel1");
        mast.Columns.Add("Fax1");
        mast.Columns.Add("Terminal");
        mast.Columns.Add("Permit");
        mast.Columns.Add("LastDate");
        mast.Columns.Add("Portnet");
        mast.Columns.Add("Ft20");
        mast.Columns.Add("Ft40");
        mast.Columns.Add("Ft45");

        mast.Columns.Add("Vessel");
        mast.Columns.Add("Voyage");
        mast.Columns.Add("Etd");
        mast.Columns.Add("Eta");
        mast.Columns.Add("Pol");
        mast.Columns.Add("ByWho");
        mast.Columns.Add("ClientRefNo");
        mast.Columns.Add("CustName");
        mast.Columns.Add("AgentName");
        mast.Columns.Add("UserData2");
        mast.Columns.Add("UserData3");
        mast.Columns.Add("UserData4");
        mast.Columns.Add("Outside");
        mast.Columns.Add("Note1");
        mast.Columns.Add("Note2");
        mast.Columns.Add("StampUser");
        mast.Columns.Add("Remark");
        mast.Columns.Add("SpecialInstruction");

        det.Columns.Add("Idx");
        det.Columns.Add("JobNo");
        det.Columns.Add("ContNo");
        det.Columns.Add("SealNo");
        det.Columns.Add("FtSize");
        det.Columns.Add("FtRemark");
        det.Columns.Add("FtType");
        det.Columns.Add("FtKgs");
        det.Columns.Add("FtQty");
        det.Columns.Add("FtPack");
        det.Columns.Add("FtTruckIn");
        det.Columns.Add("FtCbm");
        det.Columns.Add("FtNom");

        #endregion

        DataRow   row         = mast.NewRow();
        string    sql_haulier = "select Name,CrNo,Contact1,Contact2,Tel1,Fax1 from xxparty where partyid='" + obj.ClientId + "'";
        DataTable tab_hauler  = Helper.Sql.List(sql_haulier);
        row["Attn"]       = obj.Terminalcode;
        row["DeliveryTo"] = obj.DeliveryTo;
        row["CrNo"]       = "";
        row["Contact1"]   = "";
        row["Contact2"]   = "";
        row["Tel1"]       = "";
        row["Fax1"]       = "";
        if (tab_hauler.Rows.Count > 0)
        {
            row["Haulier"]  = tab_hauler.Rows[0]["Name"];
            row["CrNo"]     = tab_hauler.Rows[0]["CrNo"].ToString();
            row["Contact1"] = tab_hauler.Rows[0]["Contact1"].ToString();
            row["Contact2"] = tab_hauler.Rows[0]["Contact2"].ToString();
            row["Tel1"]     = tab_hauler.Rows[0]["Tel1"].ToString();
            row["Fax1"]     = tab_hauler.Rows[0]["Fax1"].ToString();
        }

        row["JobNo"]   = orderNo;
        row["JobType"] = obj.JobType;
        row["Vessel"]  = obj.Vessel;
        row["Voyage"]  = obj.Voyage;
        row["Permit"]  = obj.PermitNo;

        string sql = "select name from xxparty where partyid='" + obj.ClientId + "'";
        row["CustName"] = SafeValue.SafeString(ConnectSql.ExecuteScalar(sql), "");


        row["Etd"]                = obj.EtdDate.ToString("dd/MM/yyyy");
        row["Eta"]                = obj.EtaDate.ToString("dd/MM/yyyy");
        sql                       = "select name from [XXPort] where code='" + SafeValue.SafeString(obj.Pol, "") + "'";
        row["Pol"]                = SafeValue.SafeString(Helper.Sql.One(sql), "");
        sql                       = "select name from xxparty where partyid='" + obj.CarrierId + "'";
        row["Carrier"]            = SafeValue.SafeString(Helper.Sql.One(sql), "");
        row["OceanBl"]            = obj.CarrierBlNo;
        row["Yard"]               = obj.YardRef;
        row["ByWho"]              = "";
        row["ClientRefNo"]        = obj.ClientRefNo;
        row["UserData2"]          = "";
        row["SpecialInstruction"] = obj.SpecialInstruction;
        row["Remark"]             = obj.Remark;
        row["StampUser"]          = HttpContext.Current.User.Identity.Name;
        int ft20 = 0;
        int ft40 = 0;
        int ft45 = 0;


        for (int i = 0; i < objSet1.Count; i++)
        {
            C2.CtmJobDet1 cont = objSet1[i] as C2.CtmJobDet1;
            DataRow       row1 = det.NewRow();
            row1["Idx"]    = i + 1;
            row1["JobNo"]  = orderNo;
            row1["ContNo"] = cont.ContainerNo;
            row1["SealNo"] = cont.SealNo;
            string ftSize = "";
            //int index = cont.ContainerType.IndexOf("FT", 2);
            if (cont.ContainerType.IndexOf("20", 0) == 0)
            {
                ft20++;
            }
            if (cont.ContainerType.IndexOf("40", 0) == 0)
            {
                ft40++;
            }
            if (cont.ContainerType.IndexOf("45", 0) == 0)
            {
                ft45++;
            }
            row1["FtSize"] = ftSize;
            row1["FtType"] = cont.ContainerType;

            row1["FtQty"]     = cont.Qty;
            row1["FtKgs"]     = cont.Weight.ToString("0");
            row1["FtCbm"]     = cont.Volume.ToString("#,##0.00");
            row1["FtTruckIn"] = "TRUCK-IN:" + cont.ScheduleDate.ToString("dd-MMM");
            det.Rows.Add(row1);
        }
        row["Ft20"] = ft20;
        row["Ft40"] = ft40;
        row["Ft45"] = ft45;
        mast.Rows.Add(row);

        set.Tables.Add(mast);
        set.Tables.Add(det);

        return(set);
    }
Ejemplo n.º 51
0
        public void ExportExcel()
        {
            if (table == null)
            {
                return;
            }
            System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
            sfd.Filter           = "导出文件 (*.csv)|*.csv";
            sfd.FilterIndex      = 0;
            sfd.RestoreDirectory = true;
            sfd.Title            = "导出文件保存路径";
            sfd.ShowDialog();
            string strFilePath = sfd.FileName;

            if (strFilePath != "")
            {
                if (File.Exists(strFilePath))
                {
                    File.Delete(strFilePath);
                }
                StreamWriter sw          = new StreamWriter(new FileStream(strFilePath, FileMode.CreateNew), Encoding.Default);
                string       tableHeader = " ";
                foreach (DataColumn c in table.Columns)
                {
                    GridViewColumn gvc = new GridViewColumn();
                    tableHeader += myColumns[c.ColumnName.ToLower()].Column_show + ",";
                }
                sw.WriteLine(title);
                sw.WriteLine(tableHeader);

                for (int j = 0; j < table.Rows.Count; j++)
                {
                    DataRow       row = table.Rows[j];
                    StringBuilder sb  = new StringBuilder();
                    for (int i = 0; i < table.Columns.Count; i++)
                    {
                        sb.Append(row[i]);
                        sb.Append(",");
                    }
                    sw.WriteLine(sb);
                }

                //StringBuilder sum_sb = new StringBuilder();
                //for (int i = 0; i < dt.Columns.Count; i++)
                //{
                //    if (i == 0)
                //    {
                //        sum_sb.Append("共计");
                //    }
                //    else if (columnNumbers.Contains(i))
                //    {
                //        sum_sb.Append(sumColumns[columnNumbers.IndexOf(i)]);
                //    }
                //    sum_sb.Append(",");
                //}
                //sw.WriteLine(sum_sb);

                sw.Close();
                MessageBox.Show("导出文件成功!", "成功", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Ejemplo n.º 52
0
        }// OrionInsertQuery()

        internal OrionInsertQuery(OrionDatabase parentXDatabase, String tableName, DataRow sourceRow, params String[] exclusions)
            : base(parentXDatabase)
        {
            Boolean       bExcluded;
            StringBuilder strQueryString, strColumns, strValues;

            strQueryString = new StringBuilder("INSERT INTO " + tableName);
            strColumns     = new StringBuilder("(");
            strValues      = new StringBuilder("VALUES (");

            if (sourceRow != null)
            {
                foreach (DataColumn xColumnTemp in sourceRow.Table.Columns)
                {
                    bExcluded = false;
                    if (exclusions != null)
                    {
                        foreach (String strExclusionTemp in exclusions)
                        {
                            if (strExclusionTemp == xColumnTemp.ColumnName)
                            {
                                bExcluded = true;
                                break;
                            }
                        }
                    }

                    if (bExcluded == false)
                    {
                        strColumns.Append(xColumnTemp.ColumnName + ",");
                        strValues.Append(this.ParentOrionDatabase.ParameterCharacter + xColumnTemp.ColumnName + ",");
                    }
                }

                strQueryString.Append(" " + strColumns.ToString().Trim(',') + ")");
                strQueryString.Append(" " + strValues.ToString().Trim(',') + ")");
                this.QueryString = strQueryString.ToString();

                this.QueryType = QueryTypes.Insert;

                this.SQLCommand             = this.ParentOrionDatabase.CreateCommand(this.QueryString);
                this.SQLCommand.Transaction = this.ParentOrionDatabase.Transaction;

                foreach (DataColumn xColumnTemp in sourceRow.Table.Columns)
                {
                    bExcluded = false;
                    foreach (String strExclusionTemp in exclusions)
                    {
                        if (strExclusionTemp == xColumnTemp.ColumnName)
                        {
                            bExcluded = true;
                            break;
                        }
                    }

                    if (bExcluded == false)
                    {
                        this.AddParameter(xColumnTemp.ColumnName, sourceRow[xColumnTemp.ColumnName]);
                    }
                }
            }
        }// OrionInsertQuery()
Ejemplo n.º 53
0
 /// <summary>
 /// Fixed:
 /// </summary>
 private ContractSettings GetContractSettings(DataRow dataRow)
 {
     return(null);
 }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (action == ActionState.New)
            {
                try
                {
                    DataRow newRow = phoneNumbersDataSet.PhoneNumbers.NewRow();
                    newRow.BeginEdit();
                    newRow["Phonenum"]   = txtPhoneNumber.Text.Trim();
                    newRow["Subscriber"] = txtSubscriber.Text.Trim();
                    // modificare functionalitati save
                    newRow["Contract_value"] = txtContractValue.Text.Trim();
                    newRow["Contract_date"]  = txtContractDate.Text.Trim();

                    newRow.EndEdit();
                    phoneNumbersDataSet.PhoneNumbers.Rows.Add(newRow);
                    tblPhoneNumbersAdapter.Update(phoneNumbersDataSet.PhoneNumbers);
                    phoneNumbersDataSet.AcceptChanges();
                }
                catch (DataException ex)
                { phoneNumbersDataSet.RejectChanges();
                  MessageBox.Show(ex.Message); }
                btnNew.IsEnabled         = true;
                btnEdit.IsEnabled        = true;
                btnSave.IsEnabled        = false;
                btnCancel.IsEnabled      = false;
                lstPhones.IsEnabled      = true;
                btnPrevious.IsEnabled    = true;
                btnNext.IsEnabled        = true;
                txtPhoneNumber.IsEnabled = false;
                txtSubscriber.IsEnabled  = false;
                // prindere erori
                txtContractValue.IsEnabled = false;
                txtContractDate.IsEnabled  = false;
            }
            else if (action == ActionState.Edit)
            {
                try
                {
                    DataRow editRow = phoneNumbersDataSet.PhoneNumbers.Rows[lstPhones.SelectedIndex];
                    editRow.BeginEdit();
                    editRow["Phonenum"]   = txtPhoneNumber.Text.Trim();
                    editRow["Subscriber"] = txtSubscriber.Text.Trim();
                    // editare rand
                    editRow["Contract_value"] = txtContractValue.Text.Trim();
                    editRow["Contract_date"]  = txtContractDate.Text.Trim();
                    editRow.EndEdit();
                    tblPhoneNumbersAdapter.Update(phoneNumbersDataSet.PhoneNumbers);
                    phoneNumbersDataSet.AcceptChanges();
                }
                catch (DataException ex)
                {
                    phoneNumbersDataSet.RejectChanges();
                    MessageBox.Show(ex.Message);
                }
                btnNew.IsEnabled         = true;
                btnEdit.IsEnabled        = true;
                btnDelete.IsEnabled      = true;
                btnSave.IsEnabled        = false;
                btnCancel.IsEnabled      = false;
                lstPhones.IsEnabled      = true;
                btnPrevious.IsEnabled    = true;
                btnNext.IsEnabled        = true;
                txtPhoneNumber.IsEnabled = false;
                txtSubscriber.IsEnabled  = false;
                txtPhoneNumber.SetBinding(TextBox.TextProperty, txtPhoneNumberBinding);
                txtSubscriber.SetBinding(TextBox.TextProperty, txtSubscriberBinding);
                // modificare
                txtContractValue.IsEnabled = false;
                txtContractDate.IsEnabled  = false;
                txtContractValue.SetBinding(TextBox.TextProperty, txtContractValueBinding);
                txtContractDate.SetBinding(TextBox.TextProperty, txtContractDateBinding);
            }
            else
            if (action == ActionState.Delete)
            {
                try
                {
                    DataRow deleterow = phoneNumbersDataSet.PhoneNumbers.Rows[lstPhones.SelectedIndex];
                    deleterow.Delete();

                    tblPhoneNumbersAdapter.Update(phoneNumbersDataSet.PhoneNumbers);
                    phoneNumbersDataSet.AcceptChanges();
                }
                catch (DataException ex)
                {
                    phoneNumbersDataSet.RejectChanges(); MessageBox.Show(ex.Message);
                    MessageBox.Show(ex.Message);
                }
                btnNew.IsEnabled         = true;
                btnEdit.IsEnabled        = true;
                btnDelete.IsEnabled      = true;
                btnSave.IsEnabled        = false;
                btnCancel.IsEnabled      = false;
                lstPhones.IsEnabled      = true;
                btnPrevious.IsEnabled    = true;
                btnNext.IsEnabled        = true;
                txtPhoneNumber.IsEnabled = false;
                txtSubscriber.IsEnabled  = false;
                txtPhoneNumber.SetBinding(TextBox.TextProperty, txtPhoneNumberBinding);
                txtSubscriber.SetBinding(TextBox.TextProperty, txtSubscriberBinding);
                // prindere erori
                txtContractValue.IsEnabled = false;
                txtContractDate.IsEnabled  = false;
                txtContractValue.SetBinding(TextBox.TextProperty, txtContractValueBinding);
                txtContractDate.SetBinding(TextBox.TextProperty, txtContractDateBinding);
            }
        }
Ejemplo n.º 55
0
 public TenantModel(DataRow dataRow)
 {
     OnConstructing();
     Set(dataRow);
     OnConstructed();
 }
Ejemplo n.º 56
0
 public Table(DataRow row)
 {
     this.ID = (int)row["id"];
     this.Name = row["name"].ToString();
     this.Status = row["status"].ToString();
 }
Ejemplo n.º 57
0
 static void cancel(DataRow row) {
     FerretControl.cancel((string) row["ferretOrderId"], Dates.date((string) row["submittedTime"]));
 }
Ejemplo n.º 58
0
        /// <summary>
        /// compare the changed columns of a row.
        /// for some reasons, on the client the values are read from the controls, and despite the row has not changed, the row is marked modified
        /// </summary>
        public static bool IsReallyChanged(DataRow ADataRow)
        {
            int DEBUGLEVEL_REALLYCHANGED = 1;

            if (ADataRow.RowState == DataRowState.Added)
            {
                if (TLogging.DebugLevel >= DEBUGLEVEL_REALLYCHANGED)
                {
                    TLogging.Log("Row has been added:");

                    foreach (DataColumn dc in ADataRow.Table.Columns)
                    {
                        TLogging.Log("  " + dc.ColumnName + ": " + ADataRow[dc.Ordinal].ToString());
                    }
                }

                return(true);
            }
            else if (ADataRow.RowState == DataRowState.Deleted)
            {
                if (TLogging.DebugLevel >= DEBUGLEVEL_REALLYCHANGED)
                {
                    TLogging.Log("Row has been deleted:");

                    foreach (DataColumn dc in ADataRow.Table.Columns)
                    {
                        TLogging.Log("  " + dc.ColumnName + ": " + ADataRow[dc.Ordinal, DataRowVersion.Original].ToString());
                    }
                }

                return(true);
            }
            else if (ADataRow.RowState == DataRowState.Modified)
            {
                if (TLogging.DebugLevel >= DEBUGLEVEL_REALLYCHANGED)
                {
                    TLogging.Log("Row has been modified:");
                }

                bool changed = false;

                foreach (DataColumn dc in ADataRow.Table.Columns)
                {
                    if (ADataRow[dc.Ordinal, DataRowVersion.Original].ToString() != ADataRow[dc.Ordinal, DataRowVersion.Current].ToString())
                    {
                        changed = true;

                        if (TLogging.DebugLevel >= DEBUGLEVEL_REALLYCHANGED)
                        {
                            TLogging.Log("***  " + dc.ColumnName + ": from " +
                                         ADataRow[dc.Ordinal, DataRowVersion.Original].ToString() + " to " +
                                         ADataRow[dc.Ordinal, DataRowVersion.Current].ToString());
                        }
                    }
                    else
                    {
                        if (TLogging.DebugLevel >= DEBUGLEVEL_REALLYCHANGED)
                        {
                            TLogging.Log("  " + dc.ColumnName + ": " + ADataRow[dc.Ordinal, DataRowVersion.Original].ToString());
                        }
                    }
                }

                return(changed);
            }

            return(false);
        }